[ES6] JSModuleNamespaceObject's Symbol.iterator function should have name
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Aug 2016 02:50:19 +0000 (02:50 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Aug 2016 02:50:19 +0000 (02:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=160549

Reviewed by Saam Barati.

JSTests:

* modules/namespace-object-symbol-iterator-name.js: Added.
* test262.yaml:

Source/JavaScriptCore:

ES6 Module's namespace[Symbol.iterator] function should have the name, "[Symbol.iterator]".

* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::finishCreation):

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

JSTests/ChangeLog
JSTests/modules/namespace-object-symbol-iterator-name.js [new file with mode: 0644]
JSTests/test262.yaml
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp

index 1a01352..8c86ace 100644 (file)
@@ -1,3 +1,13 @@
+2016-08-04  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [ES6] JSModuleNamespaceObject's Symbol.iterator function should have name
+        https://bugs.webkit.org/show_bug.cgi?id=160549
+
+        Reviewed by Saam Barati.
+
+        * modules/namespace-object-symbol-iterator-name.js: Added.
+        * test262.yaml:
+
 2016-08-04  Keith Miller  <keith_miller@apple.com>
 
         ASSERTION FAILED: !hasInstanceValueNode->isCellConstant() || defaultHasInstanceFunction == hasInstanceValueNode->asCell()
diff --git a/JSTests/modules/namespace-object-symbol-iterator-name.js b/JSTests/modules/namespace-object-symbol-iterator-name.js
new file mode 100644 (file)
index 0000000..d74652f
--- /dev/null
@@ -0,0 +1,4 @@
+import { shouldBe } from "./resources/assert.js";
+import * as ns from "./namespace-object-symbol-iterator-name.js";
+
+shouldBe(ns[Symbol.iterator].name, "[Symbol.iterator]");
index 25c377d..983652d 100644 (file)
 - path: test262/test/language/module-code/namespace/Symbol.iterator/list-iter-next-prop-desc.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:module]
 - path: test262/test/language/module-code/namespace/Symbol.iterator/name.js
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:module]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js", "../../../../../harness/propertyHelper.js"], [:module]
 - path: test262/test/language/module-code/namespace/Symbol.iterator/prop-desc.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:module]
 - path: test262/test/language/module-code/namespace/Symbol.iterator/this-val-not-ns.js
index fc44111..b1caf9f 100644 (file)
@@ -1,3 +1,15 @@
+2016-08-04  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [ES6] JSModuleNamespaceObject's Symbol.iterator function should have name
+        https://bugs.webkit.org/show_bug.cgi?id=160549
+
+        Reviewed by Saam Barati.
+
+        ES6 Module's namespace[Symbol.iterator] function should have the name, "[Symbol.iterator]".
+
+        * runtime/JSModuleNamespaceObject.cpp:
+        (JSC::JSModuleNamespaceObject::finishCreation):
+
 2016-08-04  Keith Miller  <keith_miller@apple.com>
 
         ASSERTION FAILED: !hasInstanceValueNode->isCellConstant() || defaultHasInstanceFunction == hasInstanceValueNode->asCell()
index 40dda73..872a40c 100644 (file)
@@ -72,7 +72,8 @@ void JSModuleNamespaceObject::finishCreation(ExecState* exec, JSGlobalObject* gl
         m_exports.add(identifier);
 
     m_moduleRecord.set(vm, this, moduleRecord);
-    JSC_NATIVE_FUNCTION(vm.propertyNames->iteratorSymbol, moduleNamespaceObjectSymbolIterator, DontEnum, 0);
+    JSFunction* iteratorFunction = JSFunction::create(vm, globalObject, 0, ASCIILiteral("[Symbol.iterator]"), moduleNamespaceObjectSymbolIterator, NoIntrinsic);
+    putDirect(vm, vm.propertyNames->iteratorSymbol, iteratorFunction, DontEnum);
     putDirect(vm, vm.propertyNames->toStringTagSymbol, jsString(&vm, "Module"), DontEnum | ReadOnly);
 
     // http://www.ecma-international.org/ecma-262/6.0/#sec-module-namespace-exotic-objects-getprototypeof