Corrections to r200422
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 20:49:26 +0000 (20:49 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 20:49:26 +0000 (20:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157351

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Fix some typos in various files. Also, make separate error messages
for the this value being undefined vs null in the ArrayIteratorprototype
next function and add test.

* Scripts/builtins/builtins_model.py:
* builtins/ArrayIteratorPrototype.js:
(next):
(arrayIteratorValueNext):
(arrayIteratorKeyNext):
(arrayIteratorKeyValueNext):
* builtins/ArrayPrototype.js:
(keys):
(entries):
* builtins/TypedArrayPrototype.js:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): Deleted.
* tests/stress/array-iterators-next-error-messages.js: Added.
(assert):
(catch):

LayoutTests:

Test case had some code changed that was not intended.

* js/regress/script-tests/deltablue-for-of.js:
(deltaBlue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200428 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/js/regress/script-tests/deltablue-for-of.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Scripts/builtins/builtins_model.py
Source/JavaScriptCore/builtins/ArrayIteratorPrototype.js
Source/JavaScriptCore/builtins/ArrayPrototype.js
Source/JavaScriptCore/builtins/TypedArrayPrototype.js
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/tests/stress/array-iterators-next-error-messages.js [new file with mode: 0644]

index ce97079..fd473d7 100644 (file)
@@ -1,5 +1,17 @@
 2016-05-04  Keith Miller  <keith_miller@apple.com>
 
+        Corrections to r200422
+        https://bugs.webkit.org/show_bug.cgi?id=157351
+
+        Reviewed by Joseph Pecoraro.
+
+        Test case had some code changed that was not intended.
+
+        * js/regress/script-tests/deltablue-for-of.js:
+        (deltaBlue):
+
+2016-05-04  Keith Miller  <keith_miller@apple.com>
+
         Unreviewed, reland r200149 since the rollout had inconclusive PLT AB testing results.
 
 2016-05-04  Joseph Pecoraro  <pecoraro@apple.com>
index 6508655..432e023 100644 (file)
@@ -862,9 +862,9 @@ function change(v, newValue) {
 var planner = null;
 
 function deltaBlue() {
-  chainTest(100);
-  projectionTest(100);
+  chainTest(50);
+  projectionTest(50);
 }
 
-//for (var i = 0; i < 100; ++i)
-//    deltaBlue();
+for (var i = 0; i < 100; ++i)
+    deltaBlue();
index 647155d..c89b2a4 100644 (file)
@@ -1,5 +1,32 @@
 2016-05-04  Keith Miller  <keith_miller@apple.com>
 
+        Corrections to r200422
+        https://bugs.webkit.org/show_bug.cgi?id=157351
+
+        Reviewed by Joseph Pecoraro.
+
+        Fix some typos in various files. Also, make separate error messages
+        for the this value being undefined vs null in the ArrayIteratorprototype
+        next function and add test.
+
+        * Scripts/builtins/builtins_model.py:
+        * builtins/ArrayIteratorPrototype.js:
+        (next):
+        (arrayIteratorValueNext):
+        (arrayIteratorKeyNext):
+        (arrayIteratorKeyValueNext):
+        * builtins/ArrayPrototype.js:
+        (keys):
+        (entries):
+        * builtins/TypedArrayPrototype.js:
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init): Deleted.
+        * tests/stress/array-iterators-next-error-messages.js: Added.
+        (assert):
+        (catch):
+
+2016-05-04  Keith Miller  <keith_miller@apple.com>
+
         Unreviewed, reland r200149 since the rollout had inconclusive PLT AB testing results.
 
 2016-05-04  Mark Lam  <mark.lam@apple.com>
index 360087b..022a98b 100755 (executable)
@@ -40,11 +40,11 @@ _FRAMEWORK_CONFIG_MAP = {
     },
 }
 
-functionHeadRegExp = re.compile(r"(?:@[\w|=]+\s*\n)*(?:function)\s+\w+\s*\(.*?\)", re.MULTILINE | re.DOTALL)
+functionHeadRegExp = re.compile(r"(?:@[\w|=]+\s*\n)*function\s+\w+\s*\(.*?\)", re.MULTILINE | re.DOTALL)
 functionIntrinsicRegExp = re.compile(r"^@intrinsic=(\w+)\s*\n", re.MULTILINE | re.DOTALL)
 functionIsConstructorRegExp = re.compile(r"^@constructor", re.MULTILINE | re.DOTALL)
-functionNameRegExp = re.compile(r"(?:function)\s+(\w+)\s*\(", re.MULTILINE | re.DOTALL)
-functionParameterFinder = re.compile(r"^(?:function)\s+(?:\w+)\s*\(((?:\s*\w+)?\s*(?:\s*,\s*\w+)*)?\s*\)", re.MULTILINE | re.DOTALL)
+functionNameRegExp = re.compile(r"function\s+(\w+)\s*\(", re.MULTILINE | re.DOTALL)
+functionParameterFinder = re.compile(r"^function\s+(?:\w+)\s*\(((?:\s*\w+)?\s*(?:\s*,\s*\w+)*)?\s*\)", re.MULTILINE | re.DOTALL)
 
 multilineCommentRegExp = re.compile(r"\/\*.*?\*\/", re.MULTILINE | re.DOTALL)
 singleLineCommentRegExp = re.compile(r"\/\/.*?\n", re.MULTILINE | re.DOTALL)
index bcebe21..56595f7 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>.
- * Copyright (C) 2016a Apple Inc. All rights reserved.
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,12 +28,15 @@ function next()
 {
     "use strict";
 
-    if (this == null)
-        throw @TypeError("%ArrayIteratorPrototype%.next requires that |this| not be null or undefined");
+    if (this == null) {
+        if (this === null)
+            throw new @TypeError("%ArrayIteratorPrototype%.next requires that |this| not be null");
+        throw new @TypeError("%ArrayIteratorPrototype%.next requires that |this| not be undefined");
+    }
 
     let next = this.@arrayIteratorNext;
     if (next === @undefined)
-        throw @TypeError("%ArrayIteratorPrototype%.next requires that |this| be an Array Iterator instance");
+        throw new @TypeError("%ArrayIteratorPrototype%.next requires that |this| be an Array Iterator instance");
 
     return next.@call(this);
 }
@@ -42,7 +45,7 @@ function arrayIteratorValueNext()
 {
     "use strict";
     var done = true;
-    var value = @undefined;
+    var value;
 
     var array = this.@iteratedObject;
     if (!this.@arrayIteratorIsDone) {
@@ -64,7 +67,7 @@ function arrayIteratorKeyNext()
 {
     "use strict";
     var done = true;
-    var value = @undefined;
+    var value;
 
     var array = this.@iteratedObject;
     if (!this.@arrayIteratorIsDone) {
@@ -86,7 +89,7 @@ function arrayIteratorKeyValueNext()
 {
     "use strict";
     var done = true;
-    var value = @undefined;
+    var value;
 
     var array = this.@iteratedObject;
     if (!this.@arrayIteratorIsDone) {
index ab26d3e..1a556f6 100644 (file)
@@ -50,7 +50,7 @@ function keys()
     if (this == null) {
         if (this === null)
             throw new @TypeError("Array.prototype.keys requires that |this| not be null");
-        throw new @TypeError("Array.prototype.keys requires that |this| not be null");
+        throw new @TypeError("Array.prototype.keys requires that |this| not be undefined");
     }
 
     return new @createArrayIterator(@Object(this), @arrayIteratorKeyNext);
@@ -62,7 +62,7 @@ function entries()
     if (this == null) {
         if (this === null)
             throw new @TypeError("Array.prototype.entries requires that |this| not be null");
-        throw new @TypeError("Array.prototype.entries requires that |this| not be null");
+        throw new @TypeError("Array.prototype.entries requires that |this| not be undefined");
     }
 
     return new @createArrayIterator(@Object(this), @arrayIteratorKeyValueNext);
index be743c7..d0688cc 100644 (file)
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// Note that the intrisic @typedArrayLength checks the that the argument passed is a typed array
+// Note that the intrisic @typedArrayLength checks that the argument passed is a typed array
 // and throws if it is not.
 
 function values()
index 6b0c43c..a7dce89 100644 (file)
@@ -567,7 +567,6 @@ putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Construct
     JSFunction* privateFuncArrayIteratorKeyNext = JSFunction::createBuiltinFunction(vm, arrayIteratorPrototypeArrayIteratorKeyNextCodeGenerator(vm), this);
     JSFunction* privateFuncArrayIteratorKeyValueNext = JSFunction::createBuiltinFunction(vm, arrayIteratorPrototypeArrayIteratorKeyValueNextCodeGenerator(vm), this);
 
-
     JSObject* regExpProtoFlagsGetterObject = getGetterById(exec, m_regExpPrototype.get(), vm.propertyNames->flags);
     JSObject* regExpProtoGlobalGetterObject = getGetterById(exec, m_regExpPrototype.get(), vm.propertyNames->global);
     m_regExpProtoGlobalGetter.set(vm, this, regExpProtoGlobalGetterObject);
diff --git a/Source/JavaScriptCore/tests/stress/array-iterators-next-error-messages.js b/Source/JavaScriptCore/tests/stress/array-iterators-next-error-messages.js
new file mode 100644 (file)
index 0000000..e56754e
--- /dev/null
@@ -0,0 +1,18 @@
+function assert(a, b) {
+    if (a != b)
+        throw new Error("assertion failed");
+}
+
+next = [].values().next;
+
+try {
+    next.call(null);
+} catch(e) {
+    assert(e, "TypeError: %ArrayIteratorPrototype%.next requires that |this| not be null");
+}
+
+try {
+    next.call(undefined);
+} catch(e) {
+    assert(e, "TypeError: %ArrayIteratorPrototype%.next requires that |this| not be undefined");
+}