strictkwd.js 907 B

123456789101112131415161718
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. function Execute(s) {
  6. try {
  7. eval(s);
  8. WScript.Echo("No error");
  9. } catch (e) {
  10. WScript.Echo(e);
  11. }
  12. }
  13. Execute("(function() { function foo1() { 'use strict'; var bar1 = function yield(x) { }; }; foo1(); })();");
  14. Execute("(function() { function foo2() { var bar2 = function yield(x) { }; }; foo2(); })();");
  15. Execute("(function() { function foo3() { function f(yield) { 'use strict'; }; }; foo3(); })();");
  16. Execute("(function() { function foo3() { function f(yield) { }; }; foo3(); })();");