瀏覽代碼

Migrate Intl tests to ChakraCore.

Doug Ilijev 9 年之前
父節點
當前提交
1a42257a9d
共有 44 個文件被更改,包括 1854 次插入347 次删除
  1. 7 7
      test/Bugs/randombug.baseline
  2. 2 4
      test/Bugs/randombug.js
  3. 1 1
      test/Error/NativeErrors.js
  4. 1 1
      test/Error/errorCtor.js
  5. 80 0
      test/Intl/Collator.js
  6. 110 0
      test/Intl/CollatorOptions.js
  7. 77 0
      test/Intl/DateTimeFormatOptions.js
  8. 29 0
      test/Intl/IntlBuiltIns.js
  9. 39 0
      test/Intl/IntlHiddenInternals.js
  10. 6 0
      test/Intl/IntlInternalsHiddenFromExceptionStackTest.baseline
  11. 30 0
      test/Intl/IntlInternalsHiddenFromExceptionStackTest.js
  12. 3 0
      test/Intl/IntlInternalsHiddenFromFirstChanceExceptionStackTest.baseline
  13. 18 0
      test/Intl/IntlInternalsHiddenFromFirstChanceExceptionStackTest.js
  14. 5 0
      test/Intl/IntlTaintingTests.baseline
  15. 151 0
      test/Intl/IntlTaintingTests.js
  16. 18 0
      test/Intl/NumberFormat.baseline
  17. 91 0
      test/Intl/NumberFormat.js
  18. 67 0
      test/Intl/NumberFormatOptions.js
  19. 50 0
      test/Intl/NumberFormatOptionsImplSpecific-Win10.js
  20. 48 0
      test/Intl/NumberFormatOptionsImplSpecific-WinBlue.js
  21. 57 0
      test/Intl/SupportedLocalesOf.js
  22. 151 0
      test/Intl/TaintingPreventionTests.js
  23. 361 0
      test/Intl/intlhiddeninternals.js.dbg.baseline
  24. 116 0
      test/Intl/rlexe.xml
  25. 1 1
      test/Regex/rlexe.xml
  26. 1 1
      test/StackTrace/ErrorPrototype.js
  27. 1 1
      test/StackTrace/FunctionName.js
  28. 1 1
      test/StackTrace/LongCallStackThrow.js
  29. 1 1
      test/StackTrace/PropertyValidation.js
  30. 1 1
      test/StackTrace/SimpleThrow.js
  31. 99 99
      test/StackTrace/StackTraceLimitOOS.js
  32. 37 37
      test/StackTrace/dynamic.js
  33. 25 25
      test/StackTrace/x64StackWalk.js
  34. 27 27
      test/StackTrace/x64StackWalkLoopBody.js
  35. 8 8
      test/UnitTestFramework/TrimStackTracePath.js
  36. 1 1
      test/UnitTestFramework/UnitTestFramework.js
  37. 0 8
      test/inlining/TrimStackTracePath.js
  38. 106 106
      test/inlining/polyInliningFixedMethods.js
  39. 1 1
      test/inlining/stackTrace.js
  40. 5 0
      test/rlexedirs.xml
  41. 0 7
      test/runtests.cmd
  42. 1 1
      test/typedarray/rlexe.xml
  43. 14 8
      test/utf8/OS_2977448.js
  44. 6 0
      test/utf8/rlexe.xml

+ 7 - 7
test/Bugs/randombug.baseline

@@ -63,10 +63,10 @@ Test case 30
 Passed
 Test case 31
 Error
-	at func2 (randombug.js:287:9)
-	at testlinenumber (randombug.js:293:6)
-	at test31 (randombug.js:297:5)
-	at Global code (randombug.js:283:2)
+	at func2 (randombug.js:285:9)
+	at testlinenumber (randombug.js:291:6)
+	at test31 (randombug.js:295:5)
+	at Global code (randombug.js:281:2)
 Passed
 Test case 32
 arrObj0.length setter
@@ -93,9 +93,9 @@ passed
 Test case 40
 ReferenceError: 'undefinedFunction' is undefined
 	at eval code (eval code:1:22)
-	at testRuntimeError (randombug.js:458:9)
-	at test31 (randombug.js:462:5)
-	at Global code (randombug.js:454:2)
+	at testRuntimeError (randombug.js:456:9)
+	at test31 (randombug.js:460:5)
+	at Global code (randombug.js:452:2)
 Passed
 Test case 41
 Passed

+ 2 - 4
test/Bugs/randombug.js

@@ -3,6 +3,8 @@
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 
+WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
+
 function write()
 {
   for(var i=0;i<arguments.length;i++)
@@ -11,10 +13,6 @@ function write()
   }
 }
 
-function TrimStackTracePath(line) {
-    return line && line.replace(/\(.+\\test.bugs./ig, "(");
-}
-
 write("For Win8 934770");
 write("Test case 1");
 

+ 1 - 1
test/Error/NativeErrors.js

@@ -10,7 +10,7 @@ function TrimStackTracePath(obj)
 }
 if (this.WScript && typeof this.WScript.LoadScriptFile === "function")
 {
-    this.WScript.LoadScriptFile("TrimStackTracePath.js");
+    this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
 }
 
 function PadString(s, l)

+ 1 - 1
test/Error/errorCtor.js

@@ -10,7 +10,7 @@ function TrimStackTracePath(obj)
 }
 if (this.WScript && typeof this.WScript.LoadScriptFile === "function")
 {
-    this.WScript.LoadScriptFile("TrimStackTracePath.js");
+    this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
 }
 
 function PadString(i)

+ 80 - 0
test/Intl/Collator.js

@@ -0,0 +1,80 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+var passed = true;
+
+function testCollatorOptions(option, value, str1, str2, expected) {
+    try {
+        var options = {};
+        options[option] = value;
+        var collator = new Intl.Collator("en-US", options);
+        var actual = collator.compare(str1, str2);
+        if (actual !== expected) {
+            passed = false;
+            WScript.Echo("ERROR: Comparing '" + str1 + "' and '" + str2 + "' with option '" + option + ": " + value + "' resulted in '" + actual + "'; expected '" + expected + "'!");
+        }
+    } catch (ex) {
+        passed = false;
+        WScript.Echo("Error testCollatorOptions: " + ex.message);
+    }
+}
+
+function arrayEqual(arr1, arr2) {
+    if (arr1.length !== arr2.length) return false;
+    for (var i = 0; i < arr1.length; i++) {
+        if (arr1[i] !== arr2[i]) return false;
+    }
+    return true;
+}
+
+function testSupportedLocales(locales, expectedResult) {
+    try {
+        var actual = Intl.Collator.supportedLocalesOf(locales, { localeMatcher: "best fit" });
+        if (!arrayEqual(actual, expectedResult)) {
+            throw new Error("Calling SupportedLocalesOf on '[" + locales.join(",") + "]' doesn't match expected result '[" + expectedResult.join(",") + "]' when using best fit. Actual:[" + actual.join(",") + "]");
+        }
+        actual = Intl.Collator.supportedLocalesOf(locales, { localeMatcher: "best fit" });
+        if (!arrayEqual(actual, expectedResult)) {
+            throw new Error("Calling SupportedLocalesOf on '[" + locales.join(",") + "]' doesn't match expected result '[" + expectedResult.join(",") + "]' when using lookup. Actual: [" + actual.join(",") + "]");
+        }
+    }
+    catch (ex) {
+        passed = false;
+        WScript.Echo("Error testSupportedLocales: " + ex.message);
+    }
+}
+
+testCollatorOptions("sensitivity", "base", "A", "a", 0);
+testCollatorOptions("sensitivity", "base", "A", "B", -1);
+testCollatorOptions("sensitivity", "base", "a", "\u00E2", 0);
+testCollatorOptions("sensitivity", "accent", "A", "a", 0);
+testCollatorOptions("sensitivity", "accent", "A", "B", -1);
+testCollatorOptions("sensitivity", "accent", "a", "\u00E2", -1);
+testCollatorOptions("sensitivity", "case", "A", "a", 1);
+testCollatorOptions("sensitivity", "case", "A", "B", -1);
+testCollatorOptions("sensitivity", "case", "a", "\u00E2", 0);
+testCollatorOptions("sensitivity", "variant", "A", "a", 1);
+testCollatorOptions("sensitivity", "variant", "A", "B", -1);
+testCollatorOptions("sensitivity", "variant", "a", "\u00E2", -1);
+
+testCollatorOptions("ignorePunctuation", true, ".a", "a", 0);
+testCollatorOptions("ignorePunctuation", false, ".a", "a", -1);
+
+testCollatorOptions("numeric", true, "10", "9", 1);
+testCollatorOptions("numeric", false, "10", "9", -1);
+
+testSupportedLocales(undefined, []);
+testSupportedLocales(["en-US"], ["en-US"]);
+testSupportedLocales([], []);
+testSupportedLocales(["xxx"], []);
+
+if (new Intl.Collator("es", { collation: "trad" }).resolvedOptions().collation !== "default") {
+    WScript.Echo("Error: Collation option passed through option affects the value.");
+    passed = false;
+}
+
+if (passed === true) {
+    WScript.Echo("Pass");
+}

+ 110 - 0
test/Intl/CollatorOptions.js

@@ -0,0 +1,110 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
+
+// NOTE: \u00C0 is U+00C0 LATIN CAPITAL LETTER A WITH GRAVE
+// NOTE: \u00E4 is U+00E4 LATIN SMALL LETTER A WITH DIAERESIS
+var tests = [
+    {
+        name: "Test Valid Options Resolution",
+        body: function () {
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "variant" }).resolvedOptions().sensitivity, "variant", "Ensure that variant sensitivity is interpreted correctly.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "case" }).resolvedOptions().sensitivity, "case", "Ensure that case sensitivity is interpreted correctly.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "accent" }).resolvedOptions().sensitivity, "accent", "Ensure that accent sensitivity is interpreted correctly.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "base" }).resolvedOptions().sensitivity, "base", "Ensure that base sensitivity is interpreted correctly.");
+
+            assert.areEqual(new Intl.Collator("de-DE", { collation: "phonebk" }).resolvedOptions().collation, "default", "Ensure that collation option is ignored.");
+            assert.areEqual(new Intl.Collator("de-DE-u-co-phonebk").resolvedOptions().collation, "phonebk", "Ensure that collation unicode extension is interpreted correctly (with absent options).");
+            assert.areEqual(new Intl.Collator("de-DE-u-co-phonebk", undefined).resolvedOptions().collation, "phonebk", "Ensure that collation unicode extension is interpreted correctly (with undefined options).");
+            assert.areEqual(new Intl.Collator("de-DE-u-co-phonebk", {}).resolvedOptions().collation, "phonebk", "Ensure that collation unicode extension is interpreted correctly (with empty options).");
+
+            assert.areEqual(new Intl.Collator("de-DE").resolvedOptions().numeric, false, "Ensure numeric set to false implicitly.");
+            assert.areEqual(new Intl.Collator("de-DE", { numeric: false }).resolvedOptions().numeric, false, "Ensure numeric set to false explicitly.");
+            assert.areEqual(new Intl.Collator("de-DE", { numeric: true }).resolvedOptions().numeric, true, "Ensure numeric set to true.");
+
+            assert.areEqual(new Intl.Collator("de-DE-u-co-phonebk", { numeric: false }).resolvedOptions().collation, "phonebk", "Mixed -u-co-phonebk and numeric option false (collation).");
+            assert.areEqual(new Intl.Collator("de-DE-u-co-phonebk", { numeric: false }).resolvedOptions().numeric, false, "Mixed -u-co-phonebk and numeric option false (numeric).");
+            assert.areEqual(new Intl.Collator("de-DE-u-co-phonebk", { numeric: true }).resolvedOptions().collation, "phonebk", "Mixed -u-co-phonebk and numeric option true (collation).");
+            assert.areEqual(new Intl.Collator("de-DE-u-co-phonebk", { numeric: true }).resolvedOptions().numeric, true, "Mixed -u-co-phonebk and numeric option true (numeric).");
+
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-true").resolvedOptions().numeric, true, "Ensure that -u-kn-true is interpreted correctly.");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-false").resolvedOptions().numeric, false, "Ensure that -u-kn-false is interpreted correctly.");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-true-co-phonebk").resolvedOptions().numeric, true, "Ensure that -u-kn-true-co-phonebk is interpreted correctly (numeric).");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-true-co-phonebk").resolvedOptions().collation, "phonebk", "Ensure that -u-kn-true-co-phonebk is interpreted correctly (collation).");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-false-co-phonebk").resolvedOptions().numeric, false, "Ensure that -u-kn-false-co-phonebk is interpreted correctly (numeric).");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-false-co-phonebk").resolvedOptions().collation, "phonebk", "Ensure that -u-kn-false-co-phonebk is interpreted correctly (collation).");
+        }
+    },
+    {
+        name: "Test Valid Options Behavior",
+        body: function () {
+            assert.areEqual(new Intl.Collator("en-US").compare("a", "A"), -1, "Comparing with default options.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "variant" }).compare("a", "A"), -1, "Comparing with variant sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "variant" }).compare("\u00C0", "A"), 1, "Comparing with variant sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "variant" }).compare("a", "b"), -1, "Comparing with variant sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "case" }).compare("a", "A"), -1, "Comparing with case sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "case" }).compare("a", "b"), -1, "Comparing with case sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "case" }).compare("\u00C0", "A"), 0, "Comparing with case sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "accent" }).compare("\u00C0", "A"), 1, "Comparing with accent sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "accent" }).compare("a", "A"), 0, "Comparing with accent sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "accent" }).compare("a", "b"), -1, "Comparing with accent sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "base" }).compare("a", "A"), 0, "Comparing with base sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "base" }).compare("\u00C0", "A"), 0, "Comparing with base sensitivity.");
+            assert.areEqual(new Intl.Collator("en-US", { sensitivity: "base" }).compare("a", "b"), -1, "Comparing with base sensitivity.");
+
+            assert.areEqual(new Intl.Collator("de-DE", { collation: "phonebk" }).compare("\u00e4b", "ada"), -1, "Comparing with default collation, option ignored.");
+            assert.areEqual(new Intl.Collator("de-DE", { collation: "phonebk" }).compare("äb", "ada"), -1, "Comparing with default collation, option ignored (using explicit ä character).");
+
+            assert.areEqual(new Intl.Collator("de-DE-u-co-phonebk", {}).compare("\u00e4b", "ada"), 1, "Comparing with collation unicode extension phonebk.");
+            assert.areEqual(new Intl.Collator("de-DE-u-co-phonebk", {}).compare("äb", "ada"), 1, "Comparing with collation unicode extension phonebk (using explicit ä character).");
+            assert.areEqual(new Intl.Collator("de-DE", {}).compare("\u00e4b", "ada"), -1, "Comparing without collation option of phonebk.");
+            assert.areEqual(new Intl.Collator("de-DE", {}).compare("äb", "ada"), -1, "Comparing without collation option of phonebk (using explicit ä character).");
+
+            assert.areEqual(new Intl.Collator("de-DE", { numeric: true }).compare("21", "100"), -1, "Comparing with numeric option set to true.");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-true", {}).compare("21", "100"), -1, "Comparing with numeric unicode extension set to true.");
+            assert.areEqual(new Intl.Collator("de-DE", { numeric: false }).compare("21", "100"), 1, "Comparing with numeric option set to false.");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-false", {}).compare("21", "100"), 1, "Comparing with numeric unicode extension set to false.");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-true-co-phonebk", {}).compare("21", "100"), -1, "Comparing with collation set to phonebk and numeric set to true.");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-true-co-phonebk", {}).compare("\u00e4b", "ada"), 1, "Comparing with collation set to phonebk and numeric set to true.");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-false-co-phonebk", {}).compare("21", "100"), 1, "Comparing with collation set to phonebk and numeric set to false.");
+            assert.areEqual(new Intl.Collator("de-DE-u-kn-false-co-phonebk", {}).compare("\u00e4b", "ada"), 1, "Comparing with collation set to phonebk and numeric set to false.");
+            assert.areEqual(new Intl.Collator("en-US", { ignorePunctuation: true }).compare("aa", "a!a"), 0, "Comparing with ignore punctuation set to true.");
+            assert.areEqual(new Intl.Collator("en-US", { ignorePunctuation: false }).compare("aa", "a!a"), 1, "Comparing with ignore punctuation set to true.");
+        }
+    },
+    {
+        name: "Test Invalid Options",
+        body: function () {
+            function verifyCollatorException(locale, options, expectingInvalidOption, validValuesStr) {
+                try {
+                    //Since minute and second aren't supported alone; doing this to prevent that exception.
+                    new Intl.Collator(locale, options);
+                    assert.fail("Exception was expected. Option: " + expectingInvalidOption + "; options passed in: " + JSON.stringify(options));
+                }
+                catch (e) {
+                    if (!(e instanceof RangeError || e instanceof TypeError)) {
+                        assert.fail("Incorrect exception was thrown.");
+                    }
+                    assert.isTrue(e.message.indexOf(validValuesStr) !== -1,
+                        "Exception didn't have the correct valid values when testing option:" + expectingInvalidOption +
+                        ".\nMessage: " + e.message +
+                        "\nSearched For:" + validValuesStr);
+                }
+            }
+
+            verifyCollatorException("en-US-u-kf-invalid", {}, "caseFirst", "['upper', 'lower', 'false']");
+            verifyCollatorException("en-US", { caseFirst: "invalid" }, "caseFirst", "['upper', 'lower', 'false']");
+
+            assert.areEqual(new Intl.Collator("en-US", { numeric: "blah" }).resolvedOptions().numeric, true, "Testing invalid numeric option.");
+            assert.areEqual(new Intl.Collator("en-US-u-kn-blah", {}).resolvedOptions().numeric, false, "Testing invalid numeric option.");
+            assert.areEqual(new Intl.Collator("en-US", { ignorePunctuation: "blah" }).resolvedOptions().ignorePunctuation, true, "Testing invalid ignorePunctuation option.");
+            assert.areEqual(new Intl.Collator("en-US", { collation: "blah" }).resolvedOptions().collation, "default", "Testing invalid collation option.");
+            assert.areEqual(new Intl.Collator("en-US-u-co-blah", {}).resolvedOptions().collation, "default", "Testing invalid colation option.");
+        }
+    }
+];
+
+testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });

+ 77 - 0
test/Intl/DateTimeFormatOptions.js

@@ -0,0 +1,77 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
+
+// NOTE: \u200e is the U+200E LEFT-TO-RIGHT MARK
+var tests = [
+    {
+        name: "Test Valid Options",
+        body: function () {
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { year: "numeric" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e2000", "Formatting year as numeric.");
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { year: "2-digit" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e00", "Formatting year as 2-digit.");
+
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { month: "numeric" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e2", "Formatting month as numeric.");
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { month: "2-digit" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e02", "Formatting month as 2-digit.");
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { month: "long" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200eFebruary", "Formatting month as 2-digit.");
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { month: "short" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200eFeb", "Formatting month as numeric.");
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { month: "narrow" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200eFeb", "Formatting month as narrow.");
+
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { day: "2-digit" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e01", "Formatting day as 2-digit.");
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { day: "numeric" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e1", "Formatting day as numeric.");
+
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { hour: "2-digit" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e01\u200e \u200eAM", "Formatting hour as 2-digit.");
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { hour: "numeric" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e1\u200e \u200eAM", "Formatting hour as numeric.");
+
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { hour: "2-digit", minute: "2-digit" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e01\u200e:\u200e01\u200e \u200eAM", "Formatting hour as 2-digit and minute as 2-digit.");
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { hour: "2-digit", minute: "numeric" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e01\u200e:\u200e01\u200e \u200eAM", "Formatting hour as 2-digit and minute as numeric.");
+
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { hour: "2-digit", minute: "2-digit", second: "2-digit" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e01\u200e:\u200e01\u200e:\u200e01\u200e \u200eAM", "Formatting hour as 2-digit, minute as 2-digit and second as 2-digit.");
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { hour: "2-digit", minute: "2-digit", second: "numeric" }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e01\u200e:\u200e01\u200e:\u200e01\u200e \u200eAM", "Formatting hour as 2-digit, minute as 2-digit and second as numeric.");
+
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { hour: "numeric", hour12: true }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e1\u200e \u200eAM", "Formatting hour as numeric with hour12=true.");
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { hour: "numeric", hour12: false }).format(new Date(2000, 1, 1, 1, 1, 1)), "\u200e1\u200e:\u200e00", "Formatting hour as numeric with hour12=false.");
+        }
+    },
+    {
+        name: "Test Invalid Options",
+        body: function () {
+            function verifyDTFException(locale, option, invalidValue, validValues) {
+                if (validValues.indexOf(invalidValue) !== -1) {
+                    assert.fail("Test constructed incorrectly.");
+                }
+                try {
+                    // Since minute and second aren't supported alone; doing this to prevent that exception.
+                    var options = { hour: "numeric", minute: "numeric" };
+                    options[option] = invalidValue;
+                    new Intl.DateTimeFormat(locale, options);
+                    assert.fail("Exception was expected. Option: " + option + "; invalid value: " + invalidValue);
+                }
+                catch (e) {
+                    if (!(e instanceof RangeError)) {
+                        fail("Incorrect exception was thrown.");
+                    }
+                    assert.isTrue(e.message.indexOf(validValues) !== -1,
+                        "Checking exception message for correct values string. Looking for: " + validValues +
+                        "\nMessage: " + e.message);
+                }
+            }
+
+            verifyDTFException("en-US", "year", "long", "['2-digit', 'numeric']");
+            verifyDTFException("en-US", "month", "false", "['2-digit', 'numeric', 'narrow', 'short', 'long']");
+            verifyDTFException("en-US", "day", "long", "['2-digit', 'numeric']");
+            verifyDTFException("en-US", "hour", "long", "['2-digit', 'numeric']");
+            verifyDTFException("en-US", "minute", "long", "['2-digit', 'numeric']");
+            verifyDTFException("en-US", "second", "long", "['2-digit', 'numeric']");
+            verifyDTFException("en-US", "era", "numeric", "['narrow', 'short', 'long']");
+            verifyDTFException("en-US", "localeMatcher", "long", "['lookup', 'best fit']");
+            verifyDTFException("en-US", "formatMatcher", "long", "['basic', 'best fit']");
+
+            assert.areEqual(new Intl.DateTimeFormat("en-US", { hour: "numeric", hour12: "asdasd" }).resolvedOptions().hour12, true, "Hour12 special invalid option treatment.");
+        }
+    }
+];
+
+testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });

+ 29 - 0
test/Intl/IntlBuiltIns.js

@@ -0,0 +1,29 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+function testBuiltInFunction(options, builtInConstructor, builtInName, builtInFunc, intlConstructor, intlFunc, args) {
+    try {
+        var builtInValue = args.length === 1 ?
+            new builtInConstructor(args[0])[builtInFunc]("en-US", options) :
+            new builtInConstructor(args[0])[builtInFunc](args[1], "en-US", options);
+
+        var intlValue = new Intl[intlConstructor]("en-US", options)[intlFunc](args[0], args[1]);
+
+        if (builtInValue !== intlValue) {
+            console.log("ERROR: Result from built in function 'new " + builtInName + "()." + builtInFunc + "' doesn't match Intl." + intlConstructor + "'s function '" + intlFunc + "'!");
+        }
+    }
+    catch (ex) {
+        console.log(ex.message);
+    }
+}
+
+testBuiltInFunction({ minimumFractionDigits: 3 }, Number, "Number", "toLocaleString", "NumberFormat", "format", [5]);
+testBuiltInFunction({ sensitivity: "base" }, String, "String", "localeCompare", "Collator", "compare", ["A", "a"]);
+testBuiltInFunction({ hour: "numeric", timeZone: "UTC" }, Date, "Date", "toLocaleString", "DateTimeFormat", "format", [new Date(2000, 1, 1)]);
+testBuiltInFunction({ hour: "numeric", timeZone: "UTC" }, Date, "Date", "toLocaleTimeString", "DateTimeFormat", "format", [new Date(2000, 1, 1)]);
+testBuiltInFunction({ month: "numeric", timeZone: "UTC" }, Date, "Date", "toLocaleDateString", "DateTimeFormat", "format", [new Date(2000, 1, 1)]);
+
+console.log("Pass");

+ 39 - 0
test/Intl/IntlHiddenInternals.js

@@ -0,0 +1,39 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+var collatorExcludeList = [];
+var numberFormatExcludeList = [];
+var dateTimeFormatExcludeList = [];
+
+function testHiddenInternals(constructor, objType, excludeList) {
+    var obj = new constructor();
+
+    var properties = Object.getOwnPropertyNames(obj);
+    if (properties.length == 0) return;
+
+    var extraProperties = false;
+
+    properties.forEach(function (prop) {
+        if (excludeList.indexOf(prop) !== -1) return;
+
+        if (prop.indexOf("__", 0) === -1) {
+            WScript.Echo("Detected additional property '" + prop + "' on '" + objType + "', if property is expected update this test's exclude lists.");
+            extraProperties = true;
+        }
+    });
+    if (extraProperties) {
+        WScript.Echo("Failed for '" + objType + "'!");
+    }
+}
+
+testHiddenInternals(Intl.Collator, "Collator", collatorExcludeList);
+testHiddenInternals(Intl.NumberFormat, "NumberFormat", numberFormatExcludeList);
+testHiddenInternals(Intl.DateTimeFormat, "DateTimeFormat", dateTimeFormatExcludeList);
+
+if(Intl.hasOwnProperty("EngineInterface") === true){
+    WScript.Echo("EngineInterface object is not hidden.");
+}
+
+WScript.Echo("Pass");

+ 6 - 0
test/Intl/IntlInternalsHiddenFromExceptionStackTest.baseline

@@ -0,0 +1,6 @@
+Error: Throwing...
+   at toString (intlinternalshiddenfromexceptionstacktest.js:15:17)
+   at Intl.Collator.prototype.compare (native code)
+   at Array.prototype.sort (native code)
+   at testCallback (intlinternalshiddenfromexceptionstacktest.js:22:5)
+   at Global code (intlinternalshiddenfromexceptionstacktest.js:26:5)

+ 30 - 0
test/Intl/IntlInternalsHiddenFromExceptionStackTest.js

@@ -0,0 +1,30 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+// Tests that internal stack frames from Intl are hidden from the debugger when an exception is thrown.
+if (this.WScript) { WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js"); }
+
+function testCallback() {
+    var array =
+    [
+        {
+            toString: function ()
+            {
+                throw new Error('Throwing...');
+            }
+        },
+        5
+    ]
+
+    var c = new Intl.Collator();
+    array.sort(c.compare);
+}
+
+try {
+    testCallback();
+}
+catch (ex) {
+    WScript.Echo(TrimStackTracePath(ex.stack));
+}

+ 3 - 0
test/Intl/IntlInternalsHiddenFromFirstChanceExceptionStackTest.baseline

@@ -0,0 +1,3 @@
+RangeError: Locale 'INVALID CURRENCY CODE' is not well-formed
+   at testFirstChanceException (intlinternalshiddenfromfirstchanceexceptionstacktest.js:10:5)
+   at Global code (intlinternalshiddenfromfirstchanceexceptionstacktest.js:14:5)

+ 18 - 0
test/Intl/IntlInternalsHiddenFromFirstChanceExceptionStackTest.js

@@ -0,0 +1,18 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+// Tests that internal stack frames from Intl are hidden from the debugger when an exception is thrown.
+if (this.WScript) { WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js"); }
+
+function testFirstChanceException() {
+    var formatter = new Intl.NumberFormat("INVALID CURRENCY CODE");
+}
+
+try {
+    testFirstChanceException();
+}
+catch (ex) {
+    WScript.Echo(TrimStackTracePath(ex.stack));
+}

+ 5 - 0
test/Intl/IntlTaintingTests.baseline

@@ -0,0 +1,5 @@
+Passed object prototype tainting!
+Passed array prototype tainting!
+Passed string prototype tainting!
+Passed other tainting!
+Passed general tainting!

+ 151 - 0
test/Intl/IntlTaintingTests.js

@@ -0,0 +1,151 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+function throwFunction() { throw new Error(); }
+function verifyPropertyTainting(property, func, attributes) {
+    try {
+        attributes.configurable = true;
+        Object.defineProperty(Object.prototype, property, attributes);
+        var result = func();
+        delete Object.prototype[property];
+        return result;
+    }
+    catch (e) {
+        delete Object.prototype[property];
+        throw e;
+    }
+}
+//Pass
+verifyPropertyTainting("bob", function () { return Intl.Collator.supportedLocalesOf(); }, { value: throwFunction })
+//Actual tests, much pass (Bug 362896)
+verifyPropertyTainting("enumerable", function () { return Intl.Collator.supportedLocalesOf(); }, { value: throwFunction })
+verifyPropertyTainting("get", function () { return Intl.Collator.supportedLocalesOf(); }, { value: throwFunction })
+verifyPropertyTainting("set", function () { return Intl.Collator.supportedLocalesOf(); }, { value: throwFunction })
+
+//Testing to make sure regex doesn't change.
+"a".match(/(a)/);
+var before = {};
+Object.getOwnPropertyNames(RegExp).forEach(function (key) { before[key] = RegExp[key]; });
+new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(5);
+new Intl.Collator().compare("a", "b");
+new Intl.DateTimeFormat().format(new Date());
+Object.getOwnPropertyNames(RegExp).forEach(function (key) { if (RegExp[key] !== before[key]) WScript.Echo("Built-In regex implementation overwrote the global constructor's value."); });
+try {
+    var failed = false;
+    function getErrorFunction(global) {
+        return function () {
+            failed = true;
+            WScript.Echo("Error when tainting '" + global + "'!");
+        }
+    }
+
+    function generalTainting() {
+        failed = false;
+        Date = getErrorFunction("Date");
+        Object = getErrorFunction("Object");
+        Number = getErrorFunction("Number");
+        RegExp = getErrorFunction("RegExp");
+        String = getErrorFunction("String");
+        Boolean = getErrorFunction("Boolean");
+        Error = getErrorFunction("Error");
+        TypeError = getErrorFunction("TypeError");
+        RangeError = getErrorFunction("RangeError");
+
+        Math = {
+            abs: getErrorFunction("Math.abs"),
+            floor: getErrorFunction("Math.floor"),
+            max: getErrorFunction("Math.max"),
+            pow: getErrorFunction("Math.pow")
+        };
+
+        isFinite = getErrorFunction("isFinite");
+        isNaN = getErrorFunction("isNaN");
+
+        new Intl.NumberFormat().format(5);
+        new Intl.DateTimeFormat().format(5);
+        new Intl.Collator().compare(null, "");
+        if (failed === false) {
+            WScript.Echo("Passed general tainting!");
+        }
+    }
+
+    function objectTainting() {
+        failed = false;
+        Object.create = getErrorFunction("Object.create");
+        Object.defineProperty = getErrorFunction("Object.defineProperty");
+        Object.getPrototypeOf = getErrorFunction("Object.getPrototypeOf");
+        Object.isExtensible = getErrorFunction("Object.isExtensible");
+        Object.getOwnPropertyNames = getErrorFunction("Object.getOwnPropertyNames");
+        Object.prototype.hasOwnProperty = getErrorFunction("Object.prototype.hasOwnProperty");
+
+        new Intl.NumberFormat().format(5);
+        new Intl.DateTimeFormat().format(5);
+        new Intl.Collator().compare(null, "");
+
+        if (failed === false) {
+            WScript.Echo("Passed object prototype tainting!");
+        }
+    }
+
+    function arrayTainting() {
+        failed = false;
+        Array.prototype.forEach = getErrorFunction("Array.prototype.forEach");
+        Array.prototype.indexOf = getErrorFunction("Array.prototype.indexOf");
+        Array.prototype.push = getErrorFunction("Array.prototype.push");
+        Array.prototype.join = getErrorFunction("Array.prototype.join");
+
+        new Intl.NumberFormat().format(5);
+        new Intl.DateTimeFormat("en", { month: "short" }).format(5);
+        new Intl.Collator().compare("en", "");
+
+        if (failed === false) {
+            WScript.Echo("Passed array prototype tainting!");
+        }
+    }
+
+    function stringTainting() {
+        failed = false;
+        String.prototype.match = getErrorFunction("String.prototype.match");
+        String.prototype.replace = getErrorFunction("String.prototype.replace");
+        String.prototype.toLowerCase = getErrorFunction("String.prototype.toLowerCase");
+        String.prototype.toUpperCase = getErrorFunction("String.prototype.toUpperCase");
+
+        new Intl.NumberFormat().format(5);
+        new Intl.DateTimeFormat("en", { month: "short" }).format(5);
+        new Intl.Collator().compare("en", "");
+
+        if (failed === false) {
+            WScript.Echo("Passed string prototype tainting!");
+        }
+    }
+
+    function otherProtototypeTainting() {
+        failed = false;
+        Function.prototype.bind = getErrorFunction("Function.prototype.bind");
+        Date.prototype.getDate = getErrorFunction("Date.prototype.getDate");
+        RegExp.prototype.test = getErrorFunction("RegExp.prototype.test");
+
+        new Intl.NumberFormat().format(5);
+        new Intl.DateTimeFormat("en", { month: "short" }).format(5);
+        new Intl.Collator().compare("en", "");
+
+        if (failed === false) {
+            WScript.Echo("Passed other tainting!");
+        }
+    }
+
+    objectTainting();
+    arrayTainting();
+    stringTainting();
+    otherProtototypeTainting();
+    generalTainting();
+
+} catch (e) {
+    WScript.Echo(e);
+}
+
+Intl.NumberFormat = undefined;
+
+(0.0).toLocaleString();

+ 18 - 0
test/Intl/NumberFormat.baseline

@@ -0,0 +1,18 @@
+Option value 'NaN' for 'minimumIntegerDigits' is outside of valid range. Expected: [1 - 21]
+Option value 'Error' for 'minimumIntegerDigits' is outside of valid range. Expected: [1 - 21]
+Option value '[object Object]' for 'minimumIntegerDigits' is outside of valid range. Expected: [1 - 21]
+Option value 'null' for 'minimumIntegerDigits' is outside of valid range. Expected: [1 - 21]
+Option value '[object Object]' for 'minimumFractionDigits' is outside of valid range. Expected: [0 - 20]
+Option value 'NaN' for 'minimumFractionDigits' is outside of valid range. Expected: [0 - 20]
+Option value 'Error' for 'minimumFractionDigits' is outside of valid range. Expected: [0 - 20]
+Option value '[object Object]' for 'maximumFractionDigits' is outside of valid range. Expected: [0 - 20]
+Option value 'NaN' for 'maximumFractionDigits' is outside of valid range. Expected: [0 - 20]
+Option value 'Error' for 'maximumFractionDigits' is outside of valid range. Expected: [0 - 20]
+Option value '[object Object]' for 'minimumSignificantDigits' is outside of valid range. Expected: [1 - 21]
+Option value 'null' for 'minimumSignificantDigits' is outside of valid range. Expected: [1 - 21]
+Option value 'NaN' for 'minimumSignificantDigits' is outside of valid range. Expected: [1 - 21]
+Option value 'Error' for 'minimumSignificantDigits' is outside of valid range. Expected: [1 - 21]
+Option value '[object Object]' for 'maximumSignificantDigits' is outside of valid range. Expected: [1 - 21]
+Option value 'null' for 'maximumSignificantDigits' is outside of valid range. Expected: [1 - 21]
+Option value 'NaN' for 'maximumSignificantDigits' is outside of valid range. Expected: [1 - 21]
+Option value 'Error' for 'maximumSignificantDigits' is outside of valid range. Expected: [1 - 21]

+ 91 - 0
test/Intl/NumberFormat.js

@@ -0,0 +1,91 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+// WinTH: Changed to use non-breaking space in some output
+var NON_BREAKING_SPACE = String.fromCharCode(0xA0);
+
+function testNumberFormatOptions(opts, number, expected, altExpected) {
+    try{
+        var options = { minimumFractionDigits: 0, maximumFractionDigits: 0, minimumIntegerDigits: 1, style: "decimal", useGrouping: false };
+        for (option in opts) {
+            options[option] = opts[option];
+        }
+        var numberFormatter = new Intl.NumberFormat("en-US", options);
+        var actual = numberFormatter.format(number);
+        if (actual !== expected && actual != altExpected) {
+            WScript.Echo("ERROR: Formatting '" + number + "' with options '" + JSON.stringify(options) + "' resulted in '" + actual + "'; expected '" + expected + "'!");
+        }
+    }
+    catch (ex) {
+        WScript.Echo(ex.message);
+    }
+}
+
+function arrayEqual(arr1, arr2) {
+    if (arr1.length !== arr2.length) return false;
+    for (var i = 0; i < arr1.length; i++) {
+        if (arr1[i] !== arr2[i]) return false;
+    }
+    return true;
+}
+
+function testSupportedLocales(locales, expectedResult) {
+    try {
+        var actual = Intl.NumberFormat.supportedLocalesOf(locales, { localeMatcher: "best fit" });
+        if (!arrayEqual(actual, expectedResult)) {
+            throw new Error("Calling SupportedLocalesOf on '[" + locales.join(",") + "]' doesn't match expected result '[" + expectedResult.join(",") + "]' when using best fit. Actual:[" + actual.join(",") + "]");
+        }
+        actual = Intl.NumberFormat.supportedLocalesOf(locales, { localeMatcher: "best fit" });
+        if (!arrayEqual(actual, expectedResult)) {
+            throw new Error("Calling SupportedLocalesOf on '[" + locales.join(",") + "]' doesn't match expected result '[" + expectedResult.join(",") + "]' when using lookup. Actual: [" + actual.join(",") + "]");
+        }
+    }
+    catch (ex) {
+        passed = false;
+        WScript.Echo("Error testSupportedLocales: " + ex.message);
+    }
+}
+
+
+testNumberFormatOptions({}, 5, "5");
+testNumberFormatOptions({ minimumFractionDigits: 2, maximumFractionDigits: 2 }, 5, "5.00");
+testNumberFormatOptions({ minimumFractionDigits: 1, maximumFractionDigits: 2 }, 5, "5.0");
+testNumberFormatOptions({ minimumFractionDigits: 1, maximumFractionDigits: 2 }, 5.444, "5.44");
+testNumberFormatOptions({ minimumIntegerDigits: 2 }, 5, "05");
+testNumberFormatOptions({ minimumSignificantDigits: 2 }, 5, "5.0");
+testNumberFormatOptions({ minimumSignificantDigits: 2 }, 125, "125");
+testNumberFormatOptions({ maximumSignificantDigits: 5 }, 125.123, "125.12");
+testNumberFormatOptions({ maximumSignificantDigits: 5 }, 125.125, "125.13");
+testNumberFormatOptions({ maximumSignificantDigits: 5 }, -125.125, "-125.13");
+testNumberFormatOptions({ useGrouping: true }, 12512, "12,512");
+testNumberFormatOptions({ useGrouping: false }, 12512, "12512");
+testNumberFormatOptions({ style: "percent" }, 1.5, "150 %", /*altExpected*/"150" + NON_BREAKING_SPACE + "%");
+testNumberFormatOptions({ currency: "USD", style: "currency", maximumFractionDigits: 2, minimumFractionDigits: 2 }, 1.5, "$1.50");
+
+testNumberFormatOptions({ minimumIntegerDigits: NaN }, undefined, undefined);
+testNumberFormatOptions({ minimumIntegerDigits: "Error" }, undefined, undefined);
+testNumberFormatOptions({ minimumIntegerDigits: { foo: "bar" } }, undefined, undefined);
+testNumberFormatOptions({ minimumIntegerDigits: null }, undefined, undefined);
+testNumberFormatOptions({ minimumFractionDigits: { foo: "bar" } }, undefined, undefined);
+testNumberFormatOptions({ minimumFractionDigits: null }, "5", "5");
+testNumberFormatOptions({ minimumFractionDigits: NaN }, undefined, undefined);
+testNumberFormatOptions({ minimumFractionDigits: "Error" }, undefined, undefined);
+testNumberFormatOptions({ maximumFractionDigits: { foo: "bar" } }, undefined, undefined);
+testNumberFormatOptions({ maximumFractionDigits: null }, "5", "5");
+testNumberFormatOptions({ maximumFractionDigits: NaN }, undefined, undefined);
+testNumberFormatOptions({ maximumFractionDigits: "Error" }, undefined, undefined);
+testNumberFormatOptions({ minimumSignificantDigits: { foo: "bar" } }, undefined, undefined);
+testNumberFormatOptions({ minimumSignificantDigits: null }, undefined, undefined);
+testNumberFormatOptions({ minimumSignificantDigits: NaN }, undefined, undefined);
+testNumberFormatOptions({ minimumSignificantDigits: "Error" }, undefined, undefined);
+testNumberFormatOptions({ maximumSignificantDigits: { foo: "bar" } }, undefined, undefined);
+testNumberFormatOptions({ maximumSignificantDigits: null }, undefined, undefined);
+testNumberFormatOptions({ maximumSignificantDigits: NaN }, undefined, undefined);
+testNumberFormatOptions({ maximumSignificantDigits: "Error" }, undefined, undefined);
+
+testSupportedLocales(undefined, []);
+testSupportedLocales(["en-US"], ["en-US"]);
+testSupportedLocales([], []);
+testSupportedLocales(["xxx"], []);

+ 67 - 0
test/Intl/NumberFormatOptions.js

@@ -0,0 +1,67 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
+
+var tests = [
+    {
+        name: "Test Valid Options - Formatting Number with Significant Digits",
+        body: function () {
+            assert.areEqual(new Intl.NumberFormat("en-US", { minimumSignificantDigits: 2, maximumSignificantDigits: 2 }).format(2.131), "2.1", "max: fewer than input");
+            assert.areEqual(new Intl.NumberFormat("en-US", { minimumSignificantDigits: 2, maximumSignificantDigits: 3 }).format(2.1), "2.1", "min: same as input");
+            assert.areEqual(new Intl.NumberFormat("en-US", { minimumSignificantDigits: 3, maximumSignificantDigits: 3 }).format(2.1), "2.10", "min: more than input");
+            assert.areEqual(new Intl.NumberFormat("en-US", { minimumSignificantDigits: 3, maximumSignificantDigits: 3 }).format(123.1), "123", "max: fewer than input - no decimal");
+
+            assert.areEqual(new Intl.NumberFormat("en-US", { minimumSignificantDigits: 3, maximumSignificantDigits: 3, minimumIntegerDigits: 5, minimumFractionDigits: 5, maximumFractionDigits: 5 }).format(123.1), "123",
+                "sigfigs(min=max=3); int(min=5); fraction(min=max=5) -- maximumSignificantDigits takes precedence over min digits");
+
+            assert.areEqual(new Intl.NumberFormat("en-US", { minimumIntegerDigits: 5, minimumFractionDigits: 5, maximumFractionDigits: 5 }).format(123.1), "00,123.10000", "int(min=5); fraction(min=max=5)");
+            assert.areEqual(new Intl.NumberFormat("en-US", { minimumIntegerDigits: 1, minimumFractionDigits: 1, maximumFractionDigits: 3 }).format(123.14444), "123.144", "int(min=1); fraction(min=1,max=3)");
+        }
+    },
+    {
+        name: "Test Invalid Options",
+        body: function () {
+            function verifyNFException(locale, options, expectingInvalidOption, validValuesStr) {
+                try {
+                    //Since minute and second aren't supported alone; doing this to prevent that exception.
+                    new Intl.NumberFormat(locale, options);
+                    assert.fail("Exception was expected. Option: " + expectingInvalidOption + "; options passed in: " + JSON.stringify(options));
+                }
+                catch (e) {
+                    if (!(e instanceof RangeError || e instanceof TypeError)) {
+                        assert.fail("Incorrect exception was thrown.");
+                    }
+                    assert.isTrue(e.message.indexOf(validValuesStr) !== -1,
+                        "Exception didn't have the correct valid values when testing option:" + expectingInvalidOption +
+                        ".\nMessage: " + e.message +
+                        "\nSearched For:" + validValuesStr);
+                }
+            }
+
+            verifyNFException("en-US", { minimumSignificantDigits: -1 }, "minimumSignificantDigits", "[1 - 21]");
+            verifyNFException("en-US", { maximumSignificantDigits: -1 }, "maximumSignificantDigits", "[1 - 21]");
+            verifyNFException("en-US", { minimumFractionDigits: -1 }, "minimumFractionDigits", "[0 - 20]");
+            verifyNFException("en-US", { maximumFractionDigits: -1 }, "maximumFractionDigits", "[0 - 20]");
+            verifyNFException("en-US", { minimumIntegerDigits: -1 }, "minimumIntegerDigits", "[1 - 21]");
+
+            verifyNFException("en-US", { minimumSignificantDigits: 22 }, "minimumSignificantDigits", "[1 - 21]");
+            verifyNFException("en-US", { maximumSignificantDigits: 22 }, "maximumSignificantDigits", "[1 - 21]");
+            verifyNFException("en-US", { minimumFractionDigits: 21 }, "minimumFractionDigits", "[0 - 20]");
+            verifyNFException("en-US", { maximumFractionDigits: 21 }, "maximumFractionDigits", "[0 - 20]");
+            verifyNFException("en-US", { minimumIntegerDigits: 22 }, "minimumIntegerDigits", "[1 - 21]");
+
+            verifyNFException("en-US", { minimumSignificantDigits: 5, maximumSignificantDigits: 1 }, "maximumSignificantDigits", "[5 - 21]");
+            verifyNFException("en-US", { minimumFractionDigits: 5, maximumFractionDigits: 1 }, "maximumFractionDigits", "[5 - 20]");
+
+            verifyNFException("en-US", { style: "invalid" }, "style", "['decimal', 'percent', 'currency']");
+            verifyNFException("en-US", { style: "currency" }, "style", "Currency code was not specified");
+            verifyNFException("en-US", { style: "currency", currency: 5 }, "currency", "Currency code '5' is invalid");
+            verifyNFException("en-US", { style: "currency", currency: "USD", currencyDisplay: "invalid" }, "currencyDisplay", "['code', 'symbol', 'name']");
+        }
+    }
+];
+
+testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });

+ 50 - 0
test/Intl/NumberFormatOptionsImplSpecific-Win10.js

@@ -0,0 +1,50 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
+
+function extendOptions(base, ext) {
+    const ret = {};
+    for (const x in base) {
+        if (base.hasOwnProperty(x)) {
+            ret[x] = base[x];
+        }
+    }
+    for (const x in ext) {
+        if (ext.hasOwnProperty(x)) {
+            ret[x] = ext[x];
+        }
+    }
+    return ret;
+}
+
+const NON_BREAKING_SPACE = "\u00a0";
+
+var tests = [
+    {
+        name: "Test Valid Options - Formatting Currency with Significant Digits",
+        body: function () {
+            const usdBaseOptions = { minimumSignificantDigits: 3, maximumSignificantDigits: 3, style: "currency", currency: "USD" };
+
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(usdBaseOptions, {})).format(123.1), "$123", "currency: USD (default display)");
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(usdBaseOptions, { currencyDisplay: "code" })).format(123.1), `USD${NON_BREAKING_SPACE}123`, "currency code: USD");
+
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(usdBaseOptions, { currencyDisplay: "symbol" })).format(123.1), "$123", "currency symbol: USD ($)");
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(usdBaseOptions, { currencyDisplay: "name" })).format(123.1), `USD${NON_BREAKING_SPACE}123`, "currency name: USD");
+        }
+    },
+    {
+        name: "Test Valid Options - Formatting Percentage with Significant Digits",
+        body: function () {
+            const baseSigFigs = { minimumSignificantDigits: 3, maximumSignificantDigits: 3 };
+
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(baseSigFigs, { style: "decimal" })).format(123.1), "123", "style: decimal");
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(baseSigFigs, { style: "percent" })).format(123.1), `12,300${NON_BREAKING_SPACE}%`, "style: percent");
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(baseSigFigs, { style: "percent", useGrouping: false })).format(123.1), `12300${NON_BREAKING_SPACE}%`, "style: percent, no grouping");
+        }
+    }
+];
+
+testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });

+ 48 - 0
test/Intl/NumberFormatOptionsImplSpecific-WinBlue.js

@@ -0,0 +1,48 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
+
+function extendOptions(base, ext) {
+    const ret = {};
+    for (const x in base) {
+        if (base.hasOwnProperty(x)) {
+            ret[x] = base[x];
+        }
+    }
+    for (const x in ext) {
+        if (ext.hasOwnProperty(x)) {
+            ret[x] = ext[x];
+        }
+    }
+    return ret;
+}
+
+var tests = [
+    {
+        name: "Test Valid Options - Formatting Currency with Significant Digits",
+        body: function () {
+            const usdBaseOptions = { minimumSignificantDigits: 3, maximumSignificantDigits: 3, style: "currency", currency: "USD" };
+
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(usdBaseOptions, {})).format(123.1), "$123", "currency: USD (default display)");
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(usdBaseOptions, { currencyDisplay: "code" })).format(123.1), `USD 123`, "currency code: USD");
+
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(usdBaseOptions, { currencyDisplay: "symbol" })).format(123.1), "$123", "currency symbol: USD ($)");
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(usdBaseOptions, { currencyDisplay: "name" })).format(123.1), `USD 123`, "currency name: USD");
+        }
+    },
+    {
+        name: "Test Valid Options - Formatting Percentage with Significant Digits",
+        body: function () {
+            const baseSigFigs = { minimumSignificantDigits: 3, maximumSignificantDigits: 3 };
+
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(baseSigFigs, { style: "decimal" })).format(123.1), "123", "style: decimal");
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(baseSigFigs, { style: "percent" })).format(123.1), `12,300 %`, "style: percent");
+            assert.areEqual(new Intl.NumberFormat("en-US", extendOptions(baseSigFigs, { style: "percent", useGrouping: false })).format(123.1), `12300 %`, "style: percent, no grouping");
+        }
+    }
+];
+
+testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });

+ 57 - 0
test/Intl/SupportedLocalesOf.js

@@ -0,0 +1,57 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
+
+var tests = [
+    {
+        name: "Test Correct Errors",
+        body: function () {
+            assert.throws(function () { new Intl.Collator.supportedLocalesOf(); }, TypeError, "", "Function 'Intl.Collator.supportedLocalesOf' is not a constructor");
+            assert.throws(function () { new Intl.NumberFormat.supportedLocalesOf(); }, TypeError, "", "Function 'Intl.NumberFormat.supportedLocalesOf' is not a constructor");
+            assert.throws(function () { new Intl.DateTimeFormat.supportedLocalesOf(); }, TypeError, "", "Function 'Intl.DateTimeFormat.supportedLocalesOf' is not a constructor");
+
+            const rangeErrorMessage = "Option value 'incorrect' for 'localeMatcher' is outside of valid range. Expected: ['best fit', 'lookup']";
+            assert.throws(function () { Intl.Collator.supportedLocalesOf(["en-US"], { localeMatcher: "incorrect" }) }, RangeError, "", rangeErrorMessage);
+            assert.throws(function () { Intl.NumberFormat.supportedLocalesOf(["en-US"], { localeMatcher: "incorrect" }) }, RangeError, "", rangeErrorMessage);
+            assert.throws(function () { Intl.DateTimeFormat.supportedLocalesOf(["en-US"], { localeMatcher: "incorrect" }) }, RangeError, "", rangeErrorMessage);
+
+            assert.throws(function () { Intl.Collator.supportedLocalesOf(null) }, TypeError, "", "Object expected");
+            assert.throws(function () { Intl.NumberFormat.supportedLocalesOf(null) }, TypeError, "", "Object expected");
+            assert.throws(function () { Intl.DateTimeFormat.supportedLocalesOf(null) }, TypeError, "", "Object expected");
+
+            assert.throws(function () {
+                var locales = { get length() { throw new Error("Intentional throw"); } };
+                Intl.Collator.supportedLocalesOf(locales);
+                console.log("Intentional throw didn't throw.");
+            }, Error, "", "Intentional throw");
+        }
+    },
+    {
+        name: "",
+        body: function () {
+            const ctors = [Intl.Collator, Intl.NumberFormat, Intl.DateTimeFormat];
+
+            function test(ctor) {
+                assert.areEqual(ctor.supportedLocalesOf(["en"]).toString(), "en");
+                assert.areEqual(ctor.supportedLocalesOf(["en"], { localeMatcher: "lookup" }).toString(), "en-US");
+                assert.areEqual(ctor.supportedLocalesOf(["en"], { localeMatcher: "best fit" }).toString(), "en");
+                assert.areEqual(ctor.supportedLocalesOf().length, 0);
+                assert.areEqual(ctor.supportedLocalesOf(undefined, { localeMatcher: "lookup" }).length, 0);
+                assert.areEqual(ctor.supportedLocalesOf(undefined, { localeMatcher: "best fit" }).length, 0);
+                assert.areEqual(ctor.supportedLocalesOf.call({}, ["en"]).toString(), "en");
+                assert.areEqual(ctor.supportedLocalesOf.call({}, ["en"], { localeMatcher: "lookup" }).toString(), "en-US");
+                assert.areEqual(ctor.supportedLocalesOf.call({}, ["en"], { localeMatcher: "best fit" }).toString(), "en");
+                assert.areEqual(ctor.supportedLocalesOf.bind({})(["en"]).toString(), "en");
+                assert.areEqual(ctor.supportedLocalesOf.bind({})(["en"], { localeMatcher: "lookup" }).toString(), "en-US");
+                assert.areEqual(ctor.supportedLocalesOf.bind({})(["en"], { localeMatcher: "best fit" }).toString(), "en");
+            }
+
+            ctors.forEach(test);
+        }
+    }
+];
+
+testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });

+ 151 - 0
test/Intl/TaintingPreventionTests.js

@@ -0,0 +1,151 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
+
+var err = new Error();
+var someDate = new Date(2000, 1, 1, 1, 1, 1);
+function throwFunction() {
+    throw err;
+}
+
+//To see if Intl tainting causes some internal issues.
+var myIntl = Intl;
+
+var functionCalls = [
+    function () { return new myIntl.Collator(); },
+    function () { return new myIntl.DateTimeFormat(); },
+    function () { return new myIntl.NumberFormat(); },
+    function () { return myIntl.Collator.supportedLocalesOf(); },
+    function () { return new myIntl.Collator().compare("a", "b"); },
+    function () { return new myIntl.NumberFormat().format("5.5555555"); },
+    function () { return new myIntl.DateTimeFormat().format(someDate); },
+    function () { return new myIntl.Collator().resolvedOptions(); },
+    function () { return new myIntl.NumberFormat().resolvedOptions(); },
+    function () { return new myIntl.DateTimeFormat().resolvedOptions(); },
+    function () { try { new myIntl.Collator("zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz") } catch (e) { return e.message; } },
+    function () { try { new myIntl.NumberFormat.supportedLocalesOf(null) } catch (e) { return e.message; } },
+];
+
+function verifyGlobalTainting(global, func) {
+    var original = this[global];
+    this[global] = throwFunction;
+    try {
+        var result = func();
+        this[global] = original;
+        return result;
+    } catch (e) {
+        this[global] = original;
+        throw e;
+    }
+}
+
+Array.prototype.tryGlobalTainting = function (global) {
+    for (var i = 0; i < this.length; i++) {
+        try {
+            assert.areEqual(verifyGlobalTainting(global, this[i]), this[i](), "Tainting Global '" + global + "'.");
+        }
+        catch (e) {
+            assert.fail("Error thrown when testing Global '" + global + "'. Message: " + e + " \nStack:\n" + e.stack);
+        }
+    }
+};
+
+function verifyPropertyTainting(property, func, attributes) {
+    try {
+        attributes.configurable = true;
+        Object.defineProperty(Object.prototype, property, attributes);
+        var result = func();
+        delete Object.prototype[property];
+        return result;
+    }
+    catch (e) {
+        delete Object.prototype[property];
+        throw e;
+    }
+}
+
+Array.prototype.tryUsingGettersSetters = function (property) {
+    for (var i = 0; i < this.length; i++) {
+        try {
+            assert.areEqual(verifyPropertyTainting(property, this[i], { get: throwFunction }), this[i](), "Tainting property tainting '" + property + "' with getter.");
+            assert.areEqual(verifyPropertyTainting(property, this[i], { set: throwFunction }), this[i](), "Tainting property tainting '" + property + "' with setter.");
+            assert.areEqual(verifyPropertyTainting(property, this[i], { value: throwFunction }), this[i](), "Tainting property tainting '" + property + "' with value.");
+        }
+        catch (e) {
+            assert.fail("Error thrown when testing Global '" + property + "'. Message: " + e.message + "\n" + this[i] + "\nStack:" + e.stack);
+        }
+    }
+};
+
+var globalsList = ["Error", "TypeError", "RangeError", "Math", "Object", "String", "Number", "Date", "RegExp", "Intl", "Boolean", "Array", "Function"];
+
+//These are almost all the keywords from Intl.js; to test
+var keywords = ["__boundCompare", "__boundCompare", "__boundFormat", "__calendar", "__caseFirst", "__collation", "__currency", "__currencyDisplay", "__currencyDisplayToUse", "__day",
+    "__era", "__formatMatcher", "__formatterToUse", "__hour", "__hour12", "__ignorePunctuation", "__initializedCollator", "__initializedDateTimeFormat", "__initializedIntlObject",
+    "__initializedNumberFormat", "__locale", "__localeForCompare", "__localeMatcher", "__matcher", "__maximumFractionDigits", "__maximumSignificantDigits", "__minimumFractionDigits",
+    "__minimumIntegerDigits", "__minimumSignificantDigits", "__minute", "__month", "__numberingSystem", "__numeric", "__patternStrings", "__relevantExtensionKeys", "__second",
+    "__sensitivity", "__style", "__templateString", "__timeZone", "__timeZoneName", "__usage", "__useGrouping", "__weekday", "__windowsCalendar", "__windowsClock", "__year",
+    "12HourClock", "24HourClock", "2-digit", "A", "abbreivated", "abbreviated", "abs", "accent", "accepedCollationForLocale", "all", "always", "and", "any", "are", "arguments",
+    "ArrayInstanceForEach", "ArrayInstanceIndexOf", "ArrayInstanceJoin", "ArrayInstancePush", "as", "availableBcpTags", "b", "base", "basic", "bcp47Tag", "bcpTag", "be", "best",
+    "Boolean", "builtInCallInstanceFunction", "builtInGetArrayLength", "builtInGlobalObjectEntryIsFinite", "builtInGlobalObjectEntryIsNaN", "builtInJavascriptArrayEntryForEach",
+    "builtInJavascriptArrayEntryIndexOf", "builtInJavascriptArrayEntryJoin", "builtInJavascriptArrayEntryPush", "builtInJavascriptDateEntryGetDate", "builtInJavascriptDateEntryNow",
+    "builtInJavascriptFunctionEntryBind", "builtInJavascriptObjectEntryDefineProperty", "builtInJavascriptObjectEntryGetOwnPropertyNames", "builtInJavascriptObjectEntryGetPrototypeOf",
+    "builtInJavascriptObjectEntryHasOwnProperty", "builtInJavascriptObjectEntryIsExtensible", "builtInJavascriptRegExpEntryTest", "builtInJavascriptStringEntryMatch",
+    "builtInJavascriptStringEntryReplace", "builtInJavascriptStringEntryToLowerCase", "builtInJavascriptStringEntryToUpperCase", "builtInMathAbs", "builtInMathFloor",
+    "builtInMathMax", "builtInMathPow", "builtInSetPrototype", "ca", "cacheNumberFormat", "calendar", "callInstanceFunc", "CanonicalizeLocaleList", "case", "caseFirst",
+    "catch", "change", "co", "code", "collation", "collationAugmentedLocale", "Collator", "compare", "compareString", "configurable", "constructor", "correct", "correctDayHourMinuteSecondMonthPattern",
+    "correcting", "correctWeekdayEraMonthPattern", "count", "create", "createDateTimeFormat", "currency", "currencyCodeRE", "currencyDigits", "currencyDisplay", "current", "Date", "DateInstanceGetDate",
+    "DateNow", "DateTimeFormat", "day", "dayofweek", "decides", "decimal", "de-DE", "default", "defaultLocale", "defaultLocaleFunc", "defaults", "digits", "don", "e", "EcmaOptionsToWindowsTemplate",
+    "else", "EngineInterface", "Era", "Error", "es-ES", "ex", "extensionFilter", "fallback", "filtered", "fine", "fit", "fitter", "floor", "for", "forEach", "format", "formatDateTime",
+    "formatMatcher", "formatNumber", "formattedValue", "formatterToUse", "full", "func", "function", "FunctionInstanceBind", "functionName", "getArrayLength", "getDefaultLocale",
+    "getExtensions", "getHiddenObject", "GetNumberOption", "GetOption", "give", "givenLocales", "granularity", "GregorianCalendar", "gregory", "hand", "HasProperty", "have", "hebrew", "HebrewCalendar",
+    "HH", "hiddenObject", "hidePlatform", "HijriCalendar", "hour", "hour12", "how", "i", "if", "ignorePunctuation", "in", "InitializeCollator", "InitializeDateTimeFormat", "InitializeNumberFormat",
+    "instanceof", "integer", "Internal", "Intl", "Invalid", "is", "isFinite", "islamic", "islamic-civil", "isNaN", "isValid", "IsWellFormedCurrencyCode", "isWellFormedLanguageTag", "ja-JP",
+    "japanese", "JapaneseCalendar", "julian", "JulianCalendar", "key", "kf", "kn", "korean", "KoreanCalendar", "length", "locale", "localeCompare", "localeList", "localeMatcher", "locales",
+    "localesAcceptingCollationValues", "localeWithoutSubtags", "long", "looking", "lookup", "LookupSupportedLocales", "lower", "lv-LV", "mappedDefaultLocale", "matcher", "Math", "max",
+    "maximum", "maximumFractionDigits", "maximumFractionDigitsDefault", "maximumSignificantDigits", "message", "minimum", "minimumFractionDigits", "minimumIntegerDigits", "minimumSignificantDigits",
+    "minute", "mm", "month", "n", "name", "NaN", "narrow", "necessary", "needDefaults", "new", "newValues", "nInput", "normalizeLanguageTag", "not", "NOTE", "nRegex", "nu", "null", "num",
+    "Number", "NumberFormat", "numberingSystem", "numeric", "o", "obj", "Object", "ObjectDefineProperty", "ObjectGetOwnPropertyNames", "ObjectGetPrototypeOf", "ObjectInstanceHasOwnProperty",
+    "ObjectIsExtensible", "ObjectPrototype", "On", "opt", "option", "options", "other", "p", "parts", "pattern", "patternString", "percent", "phoneb", "phonebk", "phonetic", "pinyin",
+    "platform", "position-sensitive", "pow", "pronun", "prop", "property", "prototype", "radstr", "RaiseAssert", "raiseInvalidCurrencyCode", "raiseInvalidDate", "raiseLocaleNotWellFormed",
+    "raiseMissingCurrencyCode", "raiseNeedObject", "raiseNeedObjectOfType", "raiseNeedObjectOrString", "raiseNotAConstructor", "raiseObjectIsAlreadyInitialized", "raiseObjectIsNonExtensible",
+    "raiseOptionValueOutOfRange", "raiseOptionValueOutOfRange_3", "raiseThis_NullOrUndefined", "rawValue", "redundant", "regex", "RegExp", "RegExpInstanceTest", "registerBuiltInFunction",
+    "requestedLocales", "required", "resolved", "resolvedLocale", "resolvedLocaleInfo", "resolvedLocaleLookup", "resolvedOptions", "resolveLocaleBestFit", "resolveLocaleHelper", "resolveLocaleLookup",
+    "resolveLocales", "results", "ret", "return", "returned", "reverseLocaleAcceptingCollationValues", "rror", "s", "search", "searchParam", "second", "seen", "sensitivity",
+    "setHiddenObject", "setPrototype", "short", "shortLength", "should", "solo", "sort", "speicfy", "standard", "strict", "String", "StringInstanceMatch", "StringInstanceReplace",
+    "StringInstanceToLowerCase", "StringInstanceToUpperCase", "strings", "strippedDefaultLocale", "stroke", "style", "subset", "subTag", "subTags", "SupportedLocalesOf",
+    "supportedLocalesOfThisArg", "symbol", "t", "tag", "taiwan", "TaiwanCalendar", "temp", "template", "templates", "templateString", "thai", "ThaiCalendar", "that", "the", "then",
+    "Therefore", "this", "Thus", "time", "timeZone", "timeZoneName", "to", "ToDateTimeOptions", "toLocaleDateString", "toLocaleString", "toLocaleTimeString", "ToLogicalBoolean",
+    "ToNumber", "ToObject", "toReturn", "ToString", "ToUint32", "trad", "tradnl", "try", "twice", "type", "typeof", "-u-", "-u-co-", "UmAlQuraCalendar", "undefined", "unihan",
+    "updatePatternStrings", "upper", "usage", "use", "useGrouping", "userValue", "using", "UTC", "v", "Valid", "value", "values", "var", "variant", "was", "we", "weekday", "when",
+    "while", "will", "windows", "windowsClock", "windowsCollation", "windowsTag", "WindowsToEcmaCalendar", "WindowsToEcmaCalendarMap", "writable", "year", "FALSE", "TRUE",
+    "get", "set", "enumerable"];
+
+var tests = [
+    {
+        name: "Tainting Constructors",
+        body: function () {
+            try {
+                //Sanity check of the above function used for tainting
+                assert.throws(function () { verifyGlobalTainting("RegExp", function () { new RegExp(); }) }, Error, "Sanity check to test helper function.");
+                globalsList.forEach(functionCalls.tryGlobalTainting, functionCalls);
+            }
+            catch (e) {
+                assert.fail("Exception wasn't expected. Message: " + e);
+            }
+        }
+    },
+    {
+        name: "Tainting Properties",
+        body: function () {
+            //Sanity check of the above function used for tainting
+            assert.areEqual(verifyPropertyTainting("test", function () { return {}.test; }, { value: "Pass" }), "Pass", "Sanity check to test helper function.");
+            keywords.forEach(functionCalls.tryUsingGettersSetters, functionCalls);
+        }
+    }
+];
+
+testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });

+ 361 - 0
test/Intl/intlhiddeninternals.js.dbg.baseline

@@ -0,0 +1,361 @@
+[
+  {
+    "breakpoint": {
+      "reason": "breakpoint",
+      "location": {
+        "start": 0,
+        "length": 28,
+        "text": "var collatorExcludeList = []",
+        "frameDescription": "Global code"
+      }
+    }
+  },
+  {
+    "locals": {
+      "this": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}",
+        "collatorExcludeList": "undefined",
+        "dateTimeFormatExcludeList": "undefined",
+        "Debug": "{...}",
+        "Infinity": "Infinity",
+        "Intl": "{...}",
+        "JSON": "{...}",
+        "Math": "{...}",
+        "NaN": "NaN",
+        "numberFormatExcludeList": "undefined",
+        "SCA": "{...}",
+        "undefined": "undefined",
+        "WScript": "{...}"
+      },
+      "WScript": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}",
+        "Arguments": "[]",
+        "StdErr": "{...}"
+      },
+      "SCA": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}"
+      },
+      "ImageData": {
+        "__proto__": "<large string>",
+        "prototype": "{...}"
+      },
+      "testHiddenInternals": {
+        "__proto__": "<large string>",
+        "prototype": "{...}"
+      },
+      "collatorExcludeList": "undefined",
+      "numberFormatExcludeList": "undefined",
+      "dateTimeFormatExcludeList": "undefined"
+    }
+  },
+  {
+    "callstack": [
+      {
+        "start": 0,
+        "length": 28,
+        "text": "var collatorExcludeList = []",
+        "frameDescription": "Global code"
+      }
+    ]
+  },
+  {
+    "breakpoint": {
+      "reason": "breakpoint",
+      "location": {
+        "start": 793,
+        "length": 67,
+        "text": "testHiddenInternals(Intl.Collator, \"Collator\", collatorExcludeList)",
+        "frameDescription": "Global code"
+      }
+    }
+  },
+  {
+    "locals": {
+      "this": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}",
+        "collatorExcludeList": "[]",
+        "dateTimeFormatExcludeList": "[]",
+        "Debug": "{...}",
+        "Infinity": "Infinity",
+        "Intl": "{...}",
+        "JSON": "{...}",
+        "Math": "{...}",
+        "NaN": "NaN",
+        "numberFormatExcludeList": "[]",
+        "SCA": "{...}",
+        "undefined": "undefined",
+        "WScript": "{...}"
+      },
+      "WScript": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}",
+        "Arguments": "[]",
+        "StdErr": "{...}"
+      },
+      "SCA": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}"
+      },
+      "ImageData": {
+        "__proto__": "<large string>",
+        "prototype": "{...}"
+      },
+      "testHiddenInternals": {
+        "__proto__": "<large string>",
+        "prototype": "{...}"
+      },
+      "collatorExcludeList": {
+        "__proto__": "[]"
+      },
+      "numberFormatExcludeList": {
+        "__proto__": "[]"
+      },
+      "dateTimeFormatExcludeList": {
+        "__proto__": "[]"
+      }
+    }
+  },
+  {
+    "callstack": [
+      {
+        "start": 793,
+        "length": 67,
+        "text": "testHiddenInternals(Intl.Collator, \"Collator\", collatorExcludeList)",
+        "frameDescription": "Global code"
+      }
+    ]
+  },
+  {
+    "breakpoint": {
+      "reason": "breakpoint",
+      "location": {
+        "start": 176,
+        "length": 27,
+        "text": "var obj = new constructor()",
+        "frameDescription": "testHiddenInternals"
+      }
+    }
+  },
+  {
+    "locals": {
+      "this": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}",
+        "collatorExcludeList": "[]",
+        "dateTimeFormatExcludeList": "[]",
+        "Debug": "{...}",
+        "Infinity": "Infinity",
+        "Intl": "{...}",
+        "JSON": "{...}",
+        "Math": "{...}",
+        "NaN": "NaN",
+        "numberFormatExcludeList": "[]",
+        "SCA": "{...}",
+        "undefined": "undefined",
+        "WScript": "{...}"
+      },
+      "arguments": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}",
+        "[0]": "<large string>",
+        "[1]": "Collator",
+        "[2]": "[]",
+        "length": "3"
+      },
+      "constructor": {
+        "[Methods]": "{...}",
+        "__proto__": "<large string>",
+        "prototype": "{...}"
+      },
+      "obj": "undefined",
+      "properties": "undefined",
+      "extraProperties": "undefined",
+      "objType": "Collator",
+      "excludeList": {
+        "__proto__": "[]"
+      },
+      "[Globals]": {
+        "WScript": "{...}",
+        "SCA": "{...}",
+        "ImageData": "<large string>",
+        "testHiddenInternals": "<large string>",
+        "collatorExcludeList": "[]",
+        "numberFormatExcludeList": "[]",
+        "dateTimeFormatExcludeList": "[]"
+      }
+    }
+  },
+  {
+    "callstack": [
+      {
+        "start": 176,
+        "length": 27,
+        "text": "var obj = new constructor()",
+        "frameDescription": "testHiddenInternals"
+      },
+      {
+        "start": 793,
+        "length": 67,
+        "text": "testHiddenInternals(Intl.Collator, \"Collator\", collatorExcludeList)",
+        "frameDescription": "Global code"
+      }
+    ]
+  },
+  {
+    "breakpoint": {
+      "reason": "breakpoint",
+      "location": {
+        "start": 176,
+        "length": 27,
+        "text": "var obj = new constructor()",
+        "frameDescription": "testHiddenInternals"
+      }
+    }
+  },
+  {
+    "locals": {
+      "this": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}",
+        "collatorExcludeList": "[]",
+        "dateTimeFormatExcludeList": "[]",
+        "Debug": "{...}",
+        "Infinity": "Infinity",
+        "Intl": "{...}",
+        "JSON": "{...}",
+        "Math": "{...}",
+        "NaN": "NaN",
+        "numberFormatExcludeList": "[]",
+        "SCA": "{...}",
+        "undefined": "undefined",
+        "WScript": "{...}"
+      },
+      "arguments": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}",
+        "[0]": "<large string>",
+        "[1]": "NumberFormat",
+        "[2]": "[]",
+        "length": "3"
+      },
+      "constructor": {
+        "[Methods]": "{...}",
+        "__proto__": "<large string>",
+        "prototype": "{...}"
+      },
+      "obj": "undefined",
+      "properties": "undefined",
+      "extraProperties": "undefined",
+      "objType": "NumberFormat",
+      "excludeList": {
+        "__proto__": "[]"
+      },
+      "[Globals]": {
+        "WScript": "{...}",
+        "SCA": "{...}",
+        "ImageData": "<large string>",
+        "testHiddenInternals": "<large string>",
+        "collatorExcludeList": "[]",
+        "numberFormatExcludeList": "[]",
+        "dateTimeFormatExcludeList": "[]"
+      }
+    }
+  },
+  {
+    "callstack": [
+      {
+        "start": 176,
+        "length": 27,
+        "text": "var obj = new constructor()",
+        "frameDescription": "testHiddenInternals"
+      },
+      {
+        "start": 863,
+        "length": 79,
+        "text": "testHiddenInternals(Intl.NumberFormat, \"NumberFormat\", numberFormatExcludeList)",
+        "frameDescription": "Global code"
+      }
+    ]
+  },
+  {
+    "breakpoint": {
+      "reason": "breakpoint",
+      "location": {
+        "start": 176,
+        "length": 27,
+        "text": "var obj = new constructor()",
+        "frameDescription": "testHiddenInternals"
+      }
+    }
+  },
+  {
+    "locals": {
+      "this": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}",
+        "collatorExcludeList": "[]",
+        "dateTimeFormatExcludeList": "[]",
+        "Debug": "{...}",
+        "Infinity": "Infinity",
+        "Intl": "{...}",
+        "JSON": "{...}",
+        "Math": "{...}",
+        "NaN": "NaN",
+        "numberFormatExcludeList": "[]",
+        "SCA": "{...}",
+        "undefined": "undefined",
+        "WScript": "{...}"
+      },
+      "arguments": {
+        "[Methods]": "{...}",
+        "__proto__": "{...}",
+        "[0]": "<large string>",
+        "[1]": "<large string>",
+        "[2]": "[]",
+        "length": "3"
+      },
+      "constructor": {
+        "[Methods]": "{...}",
+        "__proto__": "<large string>",
+        "__relevantExtensionKeys": "[ca,nu]",
+        "prototype": "{...}"
+      },
+      "obj": "undefined",
+      "properties": "undefined",
+      "extraProperties": "undefined",
+      "objType": "<large string>",
+      "excludeList": {
+        "__proto__": "[]"
+      },
+      "[Globals]": {
+        "WScript": "{...}",
+        "SCA": "{...}",
+        "ImageData": "<large string>",
+        "testHiddenInternals": "<large string>",
+        "collatorExcludeList": "[]",
+        "numberFormatExcludeList": "[]",
+        "dateTimeFormatExcludeList": "[]"
+      }
+    }
+  },
+  {
+    "callstack": [
+      {
+        "start": 176,
+        "length": 27,
+        "text": "var obj = new constructor()",
+        "frameDescription": "testHiddenInternals"
+      },
+      {
+        "start": 945,
+        "length": 85,
+        "text": "testHiddenInternals(Intl.DateTimeFormat, \"DateTimeFormat\", dateTimeFormatExcludeList)",
+        "frameDescription": "Global code"
+      }
+    ]
+  }
+]

+ 116 - 0
test/Intl/rlexe.xml

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<regress-exe>
+  <test>
+    <default>
+      <compile-flags>-Intl</compile-flags>
+      <files>Collator.js</files>
+      <tags>Intl,exclude_winglob</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>CollatorOptions.js</files>
+      <compile-flags>-args summary -endargs</compile-flags>
+      <tags>Intl</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>DateTimeFormatOptions.js</files>
+      <compile-flags>-args summary -endargs</compile-flags>
+      <tags>Intl</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <compile-flags>-Intl</compile-flags>
+      <files>NumberFormat.js</files>
+      <baseline>NumberFormat.baseline</baseline>
+      <tags>Intl,exclude_winglob</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>NumberFormatOptions.js</files>
+      <compile-flags>-args summary -endargs</compile-flags>
+      <tags>Intl</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <!-- Variant of test to run on Win10 -->
+      <files>NumberFormatOptionsImplSpecific-Win10.js</files>
+      <tags>Intl,exclude_winBlue,exclude_win8,exclude_win7</tags>
+      <compile-flags>-args summary -endargs</compile-flags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <!-- Variant of test to run on WinBlue and earlier -->
+      <files>NumberFormatOptionsImplSpecific-WinBlue.js</files>
+      <tags>Intl,exclude_win10</tags>
+      <compile-flags>-args summary -endargs</compile-flags>
+    </default>
+  </test>
+
+  <test>
+    <default>
+      <compile-flags>-Intl -args summary -endargs</compile-flags>
+      <files>SupportedLocalesOf.js</files>
+      <tags>Intl,exclude_winglob</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <compile-flags>-Intl</compile-flags>
+      <files>IntlHiddenInternals.js</files>
+      <tags>Intl,exclude_winglob</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <compile-flags>-Intl</compile-flags>
+      <files>IntlTaintingTests.js</files>
+      <baseline>IntlTaintingTests.baseline</baseline>
+      <tags>Intl,exclude_winglob</tags>
+    </default>
+  </test>
+
+  <test>
+    <default>
+      <compile-flags>-Intl</compile-flags>
+      <files>IntlBuiltIns.js</files>
+      <tags>Intl,exclude_winglob</tags>
+    </default>
+  </test>
+
+  <test>
+    <default>
+      <!-- TODO (doilij) investigate why -ExtendedErrorStackForTestHost inserts tabs at the beginning of some frames -->
+      <compile-flags>-Intl -ExtendedErrorStackForTestHost-</compile-flags>
+      <files>IntlInternalsHiddenFromExceptionStackTest.js</files>
+      <baseline>IntlInternalsHiddenFromExceptionStackTest.baseline</baseline>
+      <tags>Intl,exclude_winglob</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <!-- TODO (doilij) investigate why -ExtendedErrorStackForTestHost inserts tabs at the beginning of some frames -->
+      <compile-flags>-Intl -ExtendedErrorStackForTestHost-</compile-flags>
+      <files>IntlInternalsHiddenFromFirstChanceExceptionStackTest.js</files>
+      <baseline>IntlInternalsHiddenFromFirstChanceExceptionStackTest.baseline</baseline>
+      <tags>Intl,exclude_winglob</tags>
+    </default>
+  </test>
+
+  <!-- Slow Tests -->
+
+  <test>
+    <default>
+      <files>TaintingPreventionTests.js</files>
+      <compile-flags>-args summary -endargs</compile-flags>
+      <tags>Intl,Slow</tags>
+      <timeout>900</timeout>
+    </default>
+  </test>
+</regress-exe>

+ 1 - 1
test/Regex/rlexe.xml

@@ -153,7 +153,7 @@
       <files>BoiHardFail.js</files>
       <baseline>BoiHardFail.baseline</baseline>
       <compile-flags>-regexDebug</compile-flags>
-      <tags>exclude_fre,exclude_apollo,exclude_serialized</tags>
+      <tags>exclude_fre,exclude_serialized</tags>
     </default>
   </test>
   <test>

+ 1 - 1
test/StackTrace/ErrorPrototype.js

@@ -57,6 +57,6 @@ function runtest() {
 }
 
 if (this.WScript && this.WScript.LoadScriptFile) {
-    this.WScript.LoadScriptFile("TrimStackTracePath.js");
+    this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
 }
 runtest();

+ 1 - 1
test/StackTrace/FunctionName.js

@@ -16,7 +16,7 @@ function Dump(output) {
 }
 
 if (this.WScript && this.WScript.LoadScriptFile) {
-    this.WScript.LoadScriptFile("TrimStackTracePath.js");
+    this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
 }
 
 try {

+ 1 - 1
test/StackTrace/LongCallStackThrow.js

@@ -56,7 +56,7 @@ function runtest(max, catchException)
     that["function" + (max-1)](max-1);
 }
 
-if (this.WScript && this.WScript.Arguments && this.WScript.LoadScriptFile("TrimStackTracePath.js"))
+if (this.WScript && this.WScript.Arguments && this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js"))
 {
     if (this.WScript.Arguments[0] == "runTest")
     {

+ 1 - 1
test/StackTrace/PropertyValidation.js

@@ -3,7 +3,7 @@
 // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
 //-------------------------------------------------------------------------------------------------------
 
-if (this.WScript) { WScript.LoadScriptFile("TrimStackTracePath.js"); }
+if (this.WScript) { WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js"); }
 
 function dump(output)
 {

+ 1 - 1
test/StackTrace/SimpleThrow.js

@@ -81,7 +81,7 @@ function runtest()
     foo();
 }
 
-if (this.WScript && this.WScript.Arguments && this.WScript.LoadScriptFile("TrimStackTracePath.js"))
+if (this.WScript && this.WScript.Arguments && this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js"))
 {
     if (this.WScript.Arguments[0] == "runTest")
     {

+ 99 - 99
test/StackTrace/StackTraceLimitOOS.js

@@ -1,99 +1,99 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-var output = (function(){
-    var glob = this;
-    var buf = "";
-    return {
-        clear: function() {
-            buf = "";
-        },
-        echo: function(s) {
-            buf += s + "\n";
-        },
-        all: function() {
-            return buf;
-        },
-        first: function(lines) {
-            var i = -1, len;
-            while (lines--) {
-                i = buf.indexOf("\n", i + 1);
-                if (i < 0) {
-                    break;
-                }
-                len = i;
-            }
-            return buf.substring(0, len);
-        },
-        last: function(lines) {
-            var i = buf.length;
-            while (lines--) {
-                if (i < 0) {
-                    break;
-                }
-                i = buf.lastIndexOf("\n", i - 1);
-            }
-            return buf.substring(i);
-        },
-        capture: function(f) {
-            glob.echo = this.echo;
-            f();
-            glob.echo = undefined;
-        }
-    };
-})();
-
-function Dump(output)
-{
-    if (this.echo)
-    {
-        this.echo(output);
-    }
-    else if (this.WScript)
-    {
-        WScript.Echo(output);
-    }
-    else
-    {
-        alert(output);
-    }
-}
-
-function throwExceptionWithCatch()
-{
-    try
-    {
-        throwException();
-    }
-    catch(e)
-    {
-        Dump(TrimStackTracePath(e.stack));
-    }
-}
-
-function throwException()
-{
-    function foo() {
-        bar();
-    }
-    function bar() {
-        foo();
-    }
-    foo();
-}
-
-function runtest(catchException)
-{
-    return catchException == undefined ? throwExceptionWithCatch() : throwException();
-}
-
-if (this.WScript && this.WScript.LoadScriptFile) {
-    this.WScript.LoadScriptFile("TrimStackTracePath.js");
-}
-
-Error.stackTraceLimit = Infinity;
-Dump("Error.stackTraceLimit: " + Error.stackTraceLimit);
-output.capture(runtest);
-Dump(output.first(1) + "\n   ..." + output.last(20));
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+var output = (function(){
+    var glob = this;
+    var buf = "";
+    return {
+        clear: function() {
+            buf = "";
+        },
+        echo: function(s) {
+            buf += s + "\n";
+        },
+        all: function() {
+            return buf;
+        },
+        first: function(lines) {
+            var i = -1, len;
+            while (lines--) {
+                i = buf.indexOf("\n", i + 1);
+                if (i < 0) {
+                    break;
+                }
+                len = i;
+            }
+            return buf.substring(0, len);
+        },
+        last: function(lines) {
+            var i = buf.length;
+            while (lines--) {
+                if (i < 0) {
+                    break;
+                }
+                i = buf.lastIndexOf("\n", i - 1);
+            }
+            return buf.substring(i);
+        },
+        capture: function(f) {
+            glob.echo = this.echo;
+            f();
+            glob.echo = undefined;
+        }
+    };
+})();
+
+function Dump(output)
+{
+    if (this.echo)
+    {
+        this.echo(output);
+    }
+    else if (this.WScript)
+    {
+        WScript.Echo(output);
+    }
+    else
+    {
+        alert(output);
+    }
+}
+
+function throwExceptionWithCatch()
+{
+    try
+    {
+        throwException();
+    }
+    catch(e)
+    {
+        Dump(TrimStackTracePath(e.stack));
+    }
+}
+
+function throwException()
+{
+    function foo() {
+        bar();
+    }
+    function bar() {
+        foo();
+    }
+    foo();
+}
+
+function runtest(catchException)
+{
+    return catchException == undefined ? throwExceptionWithCatch() : throwException();
+}
+
+if (this.WScript && this.WScript.LoadScriptFile) {
+    this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
+}
+
+Error.stackTraceLimit = Infinity;
+Dump("Error.stackTraceLimit: " + Error.stackTraceLimit);
+output.capture(runtest);
+Dump(output.first(1) + "\n   ..." + output.last(20));

+ 37 - 37
test/StackTrace/dynamic.js

@@ -1,38 +1,38 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-//
-// Test throw from dynamic script.
-//
-
-function Dump(output)
-{
-    if (this.WScript)
-    {
-        WScript.Echo(output);
-    }
-    else
-    {
-        alert(output);
-    }
-}
-
-function runtest()
-{
-    try {
-        (function () {
-            var f = new Function("function foo(){ throw new Error('This is my error'); } foo();");
-            f();
-        })();
-    } catch(e) {
-        Dump(TrimStackTracePath(e.stack));
-    }
-}
-
-if (this.WScript && this.WScript.LoadScriptFile) {
-    this.WScript.LoadScriptFile("TrimStackTracePath.js");
-}
-
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+//
+// Test throw from dynamic script.
+//
+
+function Dump(output)
+{
+    if (this.WScript)
+    {
+        WScript.Echo(output);
+    }
+    else
+    {
+        alert(output);
+    }
+}
+
+function runtest()
+{
+    try {
+        (function () {
+            var f = new Function("function foo(){ throw new Error('This is my error'); } foo();");
+            f();
+        })();
+    } catch(e) {
+        Dump(TrimStackTracePath(e.stack));
+    }
+}
+
+if (this.WScript && this.WScript.LoadScriptFile) {
+    this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
+}
+
 runtest();

+ 25 - 25
test/StackTrace/x64StackWalk.js

@@ -1,25 +1,25 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-if (this.WScript && this.WScript.LoadScriptFile) {
-    this.WScript.LoadScriptFile("TrimStackTracePath.js");
-}
-
-function foo(a)
-{
-    try{
-        baz();
-    }catch(ex){
-        WScript.Echo(TrimStackTracePath(ex.stack));
-    }
-    try{
-        baz();
-    }catch(ex){
-        WScript.Echo(TrimStackTracePath(ex.stack));
-    }
-}
-foo(1);
-foo(1);
-foo(1.1);
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+if (this.WScript && this.WScript.LoadScriptFile) {
+    this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
+}
+
+function foo(a)
+{
+    try{
+        baz();
+    }catch(ex){
+        WScript.Echo(TrimStackTracePath(ex.stack));
+    }
+    try{
+        baz();
+    }catch(ex){
+        WScript.Echo(TrimStackTracePath(ex.stack));
+    }
+}
+foo(1);
+foo(1);
+foo(1.1);

+ 27 - 27
test/StackTrace/x64StackWalkLoopBody.js

@@ -1,27 +1,27 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-if (this.WScript && this.WScript.LoadScriptFile) {
-    this.WScript.LoadScriptFile("TrimStackTracePath.js");
-}
-
-function bar(a)
-{
-    for(var i = 0; i<4; i++)
-    {
-        for(var j = 0; j<4; j++)
-        {
-            try
-            {
-                baz();
-            }
-            catch(ex)
-            {
-                WScript.Echo(TrimStackTracePath(ex.stack));
-            }
-        }
-    }
-}
-bar(1);
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+if (this.WScript && this.WScript.LoadScriptFile) {
+    this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
+}
+
+function bar(a)
+{
+    for(var i = 0; i<4; i++)
+    {
+        for(var j = 0; j<4; j++)
+        {
+            try
+            {
+                baz();
+            }
+            catch(ex)
+            {
+                WScript.Echo(TrimStackTracePath(ex.stack));
+            }
+        }
+    }
+}
+bar(1);

+ 8 - 8
test/Error/TrimStackTracePath.js → test/UnitTestFramework/TrimStackTracePath.js

@@ -1,8 +1,8 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-function TrimStackTracePath(line) {
-    return line && line.replace(/\(.+\\test.[^\\/]*./ig, "(");
-}
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+function TrimStackTracePath(line) {
+    return line && line.replace(/\(.+(\\test\\|\\unittest\\).[^\\/]*./ig, "(");
+}

+ 1 - 1
test/UnitTestFramework/UnitTestFramework.js

@@ -253,7 +253,7 @@ var assert = function assert() {
         areEqual: function areEqual(expected, actual, message) {
             /// <summary>
             /// IMPORTANT: NaN compares equal.<br/>
-            /// IMPORTANT: for objects, assert.AreEqual checks the fields.<br/>
+            /// IMPORTANT: for objects, assert.areEqual checks the fields.<br/>
             /// So, for 'var obj1={}, obj2={}' areEqual would be success, although in Javascript obj1 != obj2.<br/><br/>
             /// Performs deep comparison of arguments.<br/>
             /// This works for objects and simple types.<br/><br/>

+ 0 - 8
test/inlining/TrimStackTracePath.js

@@ -1,8 +0,0 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-function TrimStackTracePath(line) {
-    return line && line.replace(/\(.+\\test.StackTrace./ig, "(");
-}

+ 106 - 106
test/inlining/polyInliningFixedMethods.js

@@ -1,107 +1,107 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-if (this.WScript && this.WScript.LoadScriptFile) {
-    this.WScript.LoadScriptFile("TrimStackTracePath.js");
-}
-
-function Dump(output)
-{
-  if (this.WScript)
-  {
-    WScript.Echo(output);
-  }
-  else
-  {
-    alert(output);
-  }
-}
-
-function a() { }
-a.prototype.x = function () { WScript.Echo(1); this.y(); };
-a.prototype.y = function () { WScript.Echo("a"); };
-var a1 = new a();
-a1.f = function () { WScript.Echo(1); this.y(); };
-
-function b() { }
-b.prototype.p = 1;
-b.prototype.x = function () { WScript.Echo("b"); };
-b.prototype.f = function () { WScript.Echo("b1"); };
-b.prototype.y = function () { WScript.Echo("b"); };
-var b1 = new b();
-
-function pr(){};
-pr.f = function() {WScript.Echo("pr")};
-b.prototype = pr;
-b2 = new b();
-
-function Inheriter() {
-    this.f = function () { WScript.Echo("f"); }
-}
-
-function c() { }
-c.prototype.x = function () { WScript.Echo(2); };
-c.prototype.q = 1;
-c.prototype.p = 1;
-
-Inheriter.prototype = a.prototype;
-c.prototype = new Inheriter();
-
-var c1 = new c();
-
-function d() { }
-d.prototype.x = function () { WScript.Echo(2); };
-d.prototype.r = 1;
-d.prototype.q = 1;
-d.prototype.p = 1;
-
-//Inheriter.prototype = b.prototype;
-d.prototype = new Inheriter();
-
-var d1 = new d();
-
-function foo(func) {
-    func.f();
-}
-
-foo(b1);
-foo(b2);
-foo(b1);
-foo(d1);
-
-foo(a1);
-foo(b1);
-foo(c1);
-foo(d1);
-
-var obj1 = {};
-var func3 = function () {
-  function v6() {
-  }
-  v6.prototype.method0 = function () {
-  };
-  var v7 = new v6();
-  function v8() {
-  }
-  v8.method0 = function () {
-  };
-  v6.prototype = v8;
-  var v9 = new v6();
-  function v15(v16) {
-    for (var v18 = 0; v18 < 2; v18++) {
-      v16.method0();
-    }
-  }
-  v15(v7);
-  v15(v9);
-  v15();
-};
-
-obj1.method1 = func3;
-try {
-  obj1.method1();
-} catch(e) {
-  Dump(TrimStackTracePath(e.stack));
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+if (this.WScript && this.WScript.LoadScriptFile) {
+    this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
+}
+
+function Dump(output)
+{
+  if (this.WScript)
+  {
+    WScript.Echo(output);
+  }
+  else
+  {
+    alert(output);
+  }
+}
+
+function a() { }
+a.prototype.x = function () { WScript.Echo(1); this.y(); };
+a.prototype.y = function () { WScript.Echo("a"); };
+var a1 = new a();
+a1.f = function () { WScript.Echo(1); this.y(); };
+
+function b() { }
+b.prototype.p = 1;
+b.prototype.x = function () { WScript.Echo("b"); };
+b.prototype.f = function () { WScript.Echo("b1"); };
+b.prototype.y = function () { WScript.Echo("b"); };
+var b1 = new b();
+
+function pr(){};
+pr.f = function() {WScript.Echo("pr")};
+b.prototype = pr;
+b2 = new b();
+
+function Inheriter() {
+    this.f = function () { WScript.Echo("f"); }
+}
+
+function c() { }
+c.prototype.x = function () { WScript.Echo(2); };
+c.prototype.q = 1;
+c.prototype.p = 1;
+
+Inheriter.prototype = a.prototype;
+c.prototype = new Inheriter();
+
+var c1 = new c();
+
+function d() { }
+d.prototype.x = function () { WScript.Echo(2); };
+d.prototype.r = 1;
+d.prototype.q = 1;
+d.prototype.p = 1;
+
+//Inheriter.prototype = b.prototype;
+d.prototype = new Inheriter();
+
+var d1 = new d();
+
+function foo(func) {
+    func.f();
+}
+
+foo(b1);
+foo(b2);
+foo(b1);
+foo(d1);
+
+foo(a1);
+foo(b1);
+foo(c1);
+foo(d1);
+
+var obj1 = {};
+var func3 = function () {
+  function v6() {
+  }
+  v6.prototype.method0 = function () {
+  };
+  var v7 = new v6();
+  function v8() {
+  }
+  v8.method0 = function () {
+  };
+  v6.prototype = v8;
+  var v9 = new v6();
+  function v15(v16) {
+    for (var v18 = 0; v18 < 2; v18++) {
+      v16.method0();
+    }
+  }
+  v15(v7);
+  v15(v9);
+  v15();
+};
+
+obj1.method1 = func3;
+try {
+  obj1.method1();
+} catch(e) {
+  Dump(TrimStackTracePath(e.stack));
 }

+ 1 - 1
test/inlining/stackTrace.js

@@ -4,7 +4,7 @@
 //-------------------------------------------------------------------------------------------------------
 
 if (this.WScript && this.WScript.LoadScriptFile) {
-    this.WScript.LoadScriptFile("TrimStackTracePath.js");
+    this.WScript.LoadScriptFile("../UnitTestFramework/TrimStackTracePath.js");
 }
 
 function Dump(output)

+ 5 - 0
test/rlexedirs.xml

@@ -61,6 +61,11 @@
     <files>Date</files>
   </default>
 </dir>
+<dir>
+  <default>
+    <files>Intl</files>
+  </default>
+</dir>
 <dir>
   <default>
     <files>Error</files>

+ 0 - 7
test/runtests.cmd

@@ -304,13 +304,6 @@ goto :main
   :: If the user specified extra variants to run (i.e. in addition to the defaults), include them.
   if not "%_ExtraVariants%" == "" set _Variants=%_Variants%,%_ExtraVariants%
 
-  rem TODO: Move any apollo tests from core\test back into private unittests
-  set _ExcludeApolloTests=
-  if "%APOLLO%" == "1" (
-    set _ExcludeApolloTests=-nottags:exclude_apollo
-    set TARGET_OS=wp8
-  )
-
   if not "%_nightly%" == "1" (
     set _NOTTAGS=%_NOTTAGS% -nottags:nightly
   ) else (

+ 1 - 1
test/typedarray/rlexe.xml

@@ -144,7 +144,7 @@ Below test fails with difference in space. Investigate the cause and re-enable t
     <default>
         <files>crossthread.js</files>
         <baseline>crossthread_es6.baseline</baseline>
-        <tags>typedarray,exclude_arm,exclude_chk,exclude_apollo</tags>
+        <tags>typedarray,exclude_arm,exclude_chk</tags>
     </default>
 </test>
 -->

+ 14 - 8
test/StackTrace/TrimStackTracePath.js → test/utf8/OS_2977448.js

@@ -1,8 +1,14 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-function TrimStackTracePath(line) {
-    return line && line.replace(/\(.+\\test.StackTrace./ig, "(");
-}
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+try {
+    // Ensure that character classifier does not incorrectly classify \u2e2f as a letter.
+    eval("ⸯ");
+} catch (e) {
+    if (e instanceof SyntaxError)
+    {
+        WScript.Echo("PASS");
+    }
+}

+ 6 - 0
test/utf8/rlexe.xml

@@ -13,6 +13,12 @@
       <tags>exclude_serialized,bugfix</tags>
     </default>
   </test>
+  <test>
+    <default>
+      <files>OS_2977448.js</files>
+      <tags>fail_mutators,exclude_winglob,BugFix</tags>
+    </default>
+  </test>
   <test>
     <default>
       <files>surrogatepair.js</files>