ChakraLib_disabled.js 1.2 KB

123456789101112131415161718192021222324
  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. WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
  6. var tests = [
  7. {
  8. name: "Access to __chakraLibrary must not work",
  9. body: function () {
  10. assert.isUndefined(__chakraLibrary, "__chakraLibrary must be undefined outside of the BuiltIns methods.");
  11. },
  12. name: "Local __chakraLibrary variable must not have an impact on indexOf",
  13. body: function () {
  14. var __chakraLibrary = -1;
  15. var array = [1, 2, 3, 4];
  16. assert.areEqual(__chakraLibrary, -1, "__chakraLibrary must be -1 outside of the BuiltIns methods.");
  17. assert.areEqual(array.indexOf(4), 3, "The __chakraLibrary in the indexOf method must give access to built ins methods instead of -1.");
  18. }
  19. }
  20. ];
  21. testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });