Просмотр исходного кода

Fix .gitattributes to ignore line ending conversions for *.js files correctly. This fixes a ch debugger baseline comparison bug.

Tom Care 9 лет назад
Родитель
Сommit
40af6b8cec

+ 1 - 1
.gitattributes

@@ -1,4 +1,4 @@
 *.baseline -crlf
 *.cmd -crlf
-test/*.js -crlf
+test/**/*.js -crlf
 test/es6/HTMLComments.js binary diff=cpp

+ 21 - 21
test/Debugger/JsDiagBreakpoints.js

@@ -1,21 +1,21 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-function foo() {
-	var x = "bp A";
-	x; /**bp(A):evaluate('x');enableBp('B');deleteBp('D');**/
-	x = "Hit loc B";
-	x; /**loc(B):evaluate('x');disableBp('C');**/
-	x = "bp C, BUG";
-	x; /**bp(C):evaluate('x');**/
-	x = "bp D, BUG";
-	x; /**bp(D):evaluate('x');**/
-	x = "bp D";
-	x; /**bp:evaluate('x');**/
-}
-WScript.Attach(foo);
-WScript.Detach(foo);
-WScript.Attach(foo);
-WScript.Echo("pass");
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+function foo() {
+	var x = "bp A";
+	x; /**bp(A):evaluate('x');enableBp('B');deleteBp('D');**/
+	x = "Hit loc B";
+	x; /**loc(B):evaluate('x');disableBp('C');**/
+	x = "bp C, BUG";
+	x; /**bp(C):evaluate('x');**/
+	x = "bp D, BUG";
+	x; /**bp(D):evaluate('x');**/
+	x = "bp D";
+	x; /**bp:evaluate('x');**/
+}
+WScript.Attach(foo);
+WScript.Detach(foo);
+WScript.Attach(foo);
+WScript.Echo("pass");

+ 36 - 36
test/Debugger/JsDiagEvaluate.js

@@ -1,36 +1,36 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-globalVar = {
-  a : "Hello World",
-  b : /regex/ig
-};
-function foo() {
-  var localVar = {
-    a : {
-      b : 1
-    }
-  };
-  var x = 1; /**bp:evaluate('localVar', 2);evaluate('globalVar', 1);**/
-}
-foo();
-
-var x = NaN;
-function Level1Func() {
-  var x = null;
-  Level2Func();
-}
-
-function Level2Func() {
-  var x = -Infinity;
-  Level3Func();
-}
-
-function Level3Func() {
-  var x = Math.PI;
-  var y = 4; /**bp:evaluate('x');setFrame(1);evaluate('x');setFrame(2);evaluate('x');setFrame(3);evaluate('x');**/
-}
-Level1Func();
-WScript.Echo("pass");
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+globalVar = {
+  a : "Hello World",
+  b : /regex/ig
+};
+function foo() {
+  var localVar = {
+    a : {
+      b : 1
+    }
+  };
+  var x = 1; /**bp:evaluate('localVar', 2);evaluate('globalVar', 1);**/
+}
+foo();
+
+var x = NaN;
+function Level1Func() {
+  var x = null;
+  Level2Func();
+}
+
+function Level2Func() {
+  var x = -Infinity;
+  Level3Func();
+}
+
+function Level3Func() {
+  var x = Math.PI;
+  var y = 4; /**bp:evaluate('x');setFrame(1);evaluate('x');setFrame(2);evaluate('x');setFrame(3);evaluate('x');**/
+}
+Level1Func();
+WScript.Echo("pass");

+ 39 - 39
test/Debugger/JsDiagGetFunctionPosition.js

@@ -1,39 +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.
-//-------------------------------------------------------------------------------------------------------
-
-// Global function
-var x = 1;
-function foo() {
-  x = 2;
-}
-WScript.DumpFunctionPosition(foo);
-
-// Function property
-var obj = {
-  func : function () {
-    WScript.Echo('');
-  }
-};
-WScript.DumpFunctionPosition(obj.func);
-
-var global = WScript.LoadScript("function foo(){}", "samethread", "dummyFileName.js");
-WScript.DumpFunctionPosition(global.foo);
-
-var evalFunc = eval('new Function("a", "b", "/*some comments\\r\\n*/    return a + b;")');
-WScript.DumpFunctionPosition(evalFunc);
-
-/*some function not at 0 column*/function blah() {
-  /* First statement not at 0 */
-  var xyz = 1;
-}
-WScript.DumpFunctionPosition(blah);
-
-// Shouldn't get functionPosition of built-ins
-WScript.DumpFunctionPosition(JSON.stringify);
-WScript.DumpFunctionPosition(eval);
-
-// Shouldn't get functionPosition of library code
-WScript.DumpFunctionPosition(Intl.DateTimeFormat);
-WScript.Echo("pass");
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+// Global function
+var x = 1;
+function foo() {
+  x = 2;
+}
+WScript.DumpFunctionPosition(foo);
+
+// Function property
+var obj = {
+  func : function () {
+    WScript.Echo('');
+  }
+};
+WScript.DumpFunctionPosition(obj.func);
+
+var global = WScript.LoadScript("function foo(){}", "samethread", "dummyFileName.js");
+WScript.DumpFunctionPosition(global.foo);
+
+var evalFunc = eval('new Function("a", "b", "/*some comments\\r\\n*/    return a + b;")');
+WScript.DumpFunctionPosition(evalFunc);
+
+/*some function not at 0 column*/function blah() {
+  /* First statement not at 0 */
+  var xyz = 1;
+}
+WScript.DumpFunctionPosition(blah);
+
+// Shouldn't get functionPosition of built-ins
+WScript.DumpFunctionPosition(JSON.stringify);
+WScript.DumpFunctionPosition(eval);
+
+// Shouldn't get functionPosition of library code
+WScript.DumpFunctionPosition(Intl.DateTimeFormat);
+WScript.Echo("pass");

+ 11 - 11
test/Debugger/JsDiagGetScripts.js

@@ -1,11 +1,11 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-var global = WScript.LoadScript("", "samethread", "dummyFileName.js");
-eval('var x = "code in eval"');
-eval('eval(\'var y = "Eval inside eval"\');');
-var func = new Function("a", "b", "return a + b;");
-var x = 1;/**bp:dumpSourceList();**/
-WScript.Echo("pass");
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+var global = WScript.LoadScript("", "samethread", "dummyFileName.js");
+eval('var x = "code in eval"');
+eval('eval(\'var y = "Eval inside eval"\');');
+var func = new Function("a", "b", "return a + b;");
+var x = 1;/**bp:dumpSourceList();**/
+WScript.Echo("pass");

+ 54 - 54
test/Debugger/JsDiagGetStackProperties.js

@@ -1,54 +1,54 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-/**exception(all):locals();**/
-
-// Tests getting "exception" from JsDiagGetStackProperties
-try {
-  throw 1;
-} catch (ex) {}
-
-try {
-  throw new Error('Caught Error');
-} catch (ex) {}
-
-// Tests getting "arguments", "locals", "scopes" and "globals" from JsDiagGetStackProperties
-var globalVar = {
-  prop : 1
-};
-
-function FuncLevel1() {
-  var level1Var = {
-    prop : 1
-  };
-  function FuncLevel2() {
-    var level2Var = {
-      prop : 1
-    };
-    function FuncLevel3() {
-      var localVar1 = level1Var;
-      var localVar2 = level2Var; /**bp:locals(1);**/
-    }
-    FuncLevel3();
-  }
-  FuncLevel2();
-}
-FuncLevel1(1);
-
-// Tests getting "returnValue" and "functionCallsReturn" from JsDiagGetStackProperties
-function outerFunc1() {
-  function innerFunc1() {
-    return 1;
-  }
-  function innerFunc2() {
-    return "2";
-  }
-  function innerFunc3() {
-    return new Object(3);
-  }
-  return innerFunc1() + innerFunc2() + innerFunc3(); /**bp:resume('step_over');locals(1);**/
-}
-outerFunc1();
-WScript.Echo("pass");
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+/**exception(all):locals();**/
+
+// Tests getting "exception" from JsDiagGetStackProperties
+try {
+  throw 1;
+} catch (ex) {}
+
+try {
+  throw new Error('Caught Error');
+} catch (ex) {}
+
+// Tests getting "arguments", "locals", "scopes" and "globals" from JsDiagGetStackProperties
+var globalVar = {
+  prop : 1
+};
+
+function FuncLevel1() {
+  var level1Var = {
+    prop : 1
+  };
+  function FuncLevel2() {
+    var level2Var = {
+      prop : 1
+    };
+    function FuncLevel3() {
+      var localVar1 = level1Var;
+      var localVar2 = level2Var; /**bp:locals(1);**/
+    }
+    FuncLevel3();
+  }
+  FuncLevel2();
+}
+FuncLevel1(1);
+
+// Tests getting "returnValue" and "functionCallsReturn" from JsDiagGetStackProperties
+function outerFunc1() {
+  function innerFunc1() {
+    return 1;
+  }
+  function innerFunc2() {
+    return "2";
+  }
+  function innerFunc3() {
+    return new Object(3);
+  }
+  return innerFunc1() + innerFunc2() + innerFunc3(); /**bp:resume('step_over');locals(1);**/
+}
+outerFunc1();
+WScript.Echo("pass");

+ 34 - 34
test/Debugger/JsDiagGetStackTrace.js

@@ -1,34 +1,34 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-/**exception(all):stack();**/
-
-function fromEval() {
-  try {
-    throw new Error('Caught Error');
-  } catch (ex) {}
-}
-
-function foo() {
-  eval("fromEval();");
-}
-foo();
-
-function FuncLevel2() {
-  var level2Var = 1;
-  function FuncLevel3() {
-    var level3Var = level2Var; /**bp:stack();**/
-  }
-  FuncLevel3();
-}
-
-var globalVar = Math;
-
-function FuncLevel1() {
-  var level1Var = globalVar;
-  FuncLevel2();
-}
-FuncLevel1(1);
-WScript.Echo("pass");
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+/**exception(all):stack();**/
+
+function fromEval() {
+  try {
+    throw new Error('Caught Error');
+  } catch (ex) {}
+}
+
+function foo() {
+  eval("fromEval();");
+}
+foo();
+
+function FuncLevel2() {
+  var level2Var = 1;
+  function FuncLevel3() {
+    var level3Var = level2Var; /**bp:stack();**/
+  }
+  FuncLevel3();
+}
+
+var globalVar = Math;
+
+function FuncLevel1() {
+  var level1Var = globalVar;
+  FuncLevel2();
+}
+FuncLevel1(1);
+WScript.Echo("pass");

+ 21 - 21
test/Debugger/JsDiagRequestAsyncBreak.js

@@ -1,21 +1,21 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-/**onasyncbreak:evaluate('count');enableBp('A');**/
-
-var count = 0;
-while (count++ < 5) {
-  if (count == 3) {
-    WScript.RequestAsyncBreak();
-  }
-}
-
-function foo() {
-  var x = 1;
-  x = 2; /**loc(A):stack();**/
-}
-foo();
-
-WScript.Echo("pass");
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+/**onasyncbreak:evaluate('count');enableBp('A');**/
+
+var count = 0;
+while (count++ < 5) {
+  if (count == 3) {
+    WScript.RequestAsyncBreak();
+  }
+}
+
+function foo() {
+  var x = 1;
+  x = 2; /**loc(A):stack();**/
+}
+foo();
+
+WScript.Echo("pass");

+ 58 - 58
test/Debugger/JsrtDebugUtilsAddPropertyType.js

@@ -1,58 +1,58 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-var obj = {
-  a1 : undefined,
-  a2 : null,
-  a3 : false,
-  a4 : new Boolean(true),
-  a5 : 1,
-  a6 : 1.2,
-  a7 : NaN,
-  a8 : Infinity,
-  a9 : -Infinity,
-  a10 : 0,
-  a11 : -0,
-  a12 : "Hello World!",
-  a13 : Symbol('symbol'),
-  a14 : function func() {},
-  a15 : [],
-  a16 : [1, 2, 3],
-  a17 : [1.1, 2.2, 3.3],
-  a18 : {},
-  a19 : new RegExp('Hello World!'),
-  a20 : new Error('Hello World!'),
-  a21 : new TypeError('Hello World!'),
-  a22 : new String('Hello World!'),
-  a23 : new Number(100),
-  a24 : new Number(1.1),
-  a25 : new Map(),
-  a26 : new Set(),
-  a27 : new WeakMap(),
-  a28 : new WeakSet(),
-  a29 : new ArrayBuffer(10),
-  a30 : new Int8Array(1),
-  a31 : new Uint8Array(1),
-  a32 : new Uint8ClampedArray(1),
-  a33 : new Int16Array(1),
-  a34 : new Uint16Array(1),
-  a35 : new Int32Array(1),
-  a36 : new Uint32Array(1),
-  a37 : new Float32Array(1),
-  a38 : new Float64Array(1),
-  a39 : new DataView(new ArrayBuffer(10))
-}
-
-obj; /**bp:evaluate('obj', 2);**/
-
-var target = {};
-var handler = {};
-var obj2 = {
-  a1 : new Proxy(target, handler)
-};
-
-obj2; /**bp:evaluate('obj2.a1', 2);**/
-obj2; /**bp:evaluate('obj2.a2 = 1');**/
-WScript.Echo("pass");
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+var obj = {
+  a1 : undefined,
+  a2 : null,
+  a3 : false,
+  a4 : new Boolean(true),
+  a5 : 1,
+  a6 : 1.2,
+  a7 : NaN,
+  a8 : Infinity,
+  a9 : -Infinity,
+  a10 : 0,
+  a11 : -0,
+  a12 : "Hello World!",
+  a13 : Symbol('symbol'),
+  a14 : function func() {},
+  a15 : [],
+  a16 : [1, 2, 3],
+  a17 : [1.1, 2.2, 3.3],
+  a18 : {},
+  a19 : new RegExp('Hello World!'),
+  a20 : new Error('Hello World!'),
+  a21 : new TypeError('Hello World!'),
+  a22 : new String('Hello World!'),
+  a23 : new Number(100),
+  a24 : new Number(1.1),
+  a25 : new Map(),
+  a26 : new Set(),
+  a27 : new WeakMap(),
+  a28 : new WeakSet(),
+  a29 : new ArrayBuffer(10),
+  a30 : new Int8Array(1),
+  a31 : new Uint8Array(1),
+  a32 : new Uint8ClampedArray(1),
+  a33 : new Int16Array(1),
+  a34 : new Uint16Array(1),
+  a35 : new Int32Array(1),
+  a36 : new Uint32Array(1),
+  a37 : new Float32Array(1),
+  a38 : new Float64Array(1),
+  a39 : new DataView(new ArrayBuffer(10))
+}
+
+obj; /**bp:evaluate('obj', 2);**/
+
+var target = {};
+var handler = {};
+var obj2 = {
+  a1 : new Proxy(target, handler)
+};
+
+obj2; /**bp:evaluate('obj2.a1', 2);**/
+obj2; /**bp:evaluate('obj2.a2 = 1');**/
+WScript.Echo("pass");

+ 14 - 14
test/typedarray/memset_neg.js

@@ -1,15 +1,15 @@
-//-------------------------------------------------------------------------------------------------------
-// Copyright (C) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
-//-------------------------------------------------------------------------------------------------------
-
-function foo() {
-  var a = new Int8Array(500);
-  for(var i = 500; i < 1000; ++i) {
-    a[i] = 0;
-  }
-}
-
-foo();
-foo();
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+function foo() {
+  var a = new Int8Array(500);
+  for(var i = 500; i < 1000; ++i) {
+    a[i] = 0;
+  }
+}
+
+foo();
+foo();
 WScript.Echo("PASSED");

+ 25 - 25
test/typedarray/typedarray_bugfixes.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.
-//-------------------------------------------------------------------------------------------------------
-
-WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
-
-var tests = [
-  {
-    name: "OS4927797: TypeofElem fastpath mishandling out-of-range scenario",
-    body: function () {
-        assert.areEqual("undefined", typeof new Int8Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Int8Array");
-        assert.areEqual("undefined", typeof new Uint8Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Uint8Array");
-        assert.areEqual("undefined", typeof new Uint8ClampedArray()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Uint8ClampedArray");
-        assert.areEqual("undefined", typeof new Int16Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Int16Array");
-        assert.areEqual("undefined", typeof new Uint16Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Uint16Array");
-        assert.areEqual("undefined", typeof new Int32Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Int32Array");
-        assert.areEqual("undefined", typeof new Uint32Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Uint32Array");
-        assert.areEqual("undefined", typeof new Float32Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Float32Array");
-        assert.areEqual("undefined", typeof new Float64Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Float64Array");
-    }
-  },
-];
-
-testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });
+//-------------------------------------------------------------------------------------------------------
+// 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: "OS4927797: TypeofElem fastpath mishandling out-of-range scenario",
+    body: function () {
+        assert.areEqual("undefined", typeof new Int8Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Int8Array");
+        assert.areEqual("undefined", typeof new Uint8Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Uint8Array");
+        assert.areEqual("undefined", typeof new Uint8ClampedArray()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Uint8ClampedArray");
+        assert.areEqual("undefined", typeof new Int16Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Int16Array");
+        assert.areEqual("undefined", typeof new Uint16Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Uint16Array");
+        assert.areEqual("undefined", typeof new Int32Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Int32Array");
+        assert.areEqual("undefined", typeof new Uint32Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Uint32Array");
+        assert.areEqual("undefined", typeof new Float32Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Float32Array");
+        assert.areEqual("undefined", typeof new Float64Array()[NaN & 0XF], "TypeofElem should return 'undefined' for out-of-range situation in Float64Array");
+    }
+  },
+];
+
+testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });