Title: [204848] trunk
Revision
204848
Author
[email protected]
Date
2016-08-23 12:07:33 -0700 (Tue, 23 Aug 2016)

Log Message

[ES6] Module namespace object's Symbol.iterator method should only accept module namespace objects
https://bugs.webkit.org/show_bug.cgi?id=161097

Reviewed by Keith Miller.

JSTests:

* test262.yaml:

Source/_javascript_Core:

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

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (204847 => 204848)


--- trunk/JSTests/ChangeLog	2016-08-23 19:02:48 UTC (rev 204847)
+++ trunk/JSTests/ChangeLog	2016-08-23 19:07:33 UTC (rev 204848)
@@ -1,3 +1,12 @@
+2016-08-23  Yusuke Suzuki  <[email protected]>
+
+        [ES6] Module namespace object's Symbol.iterator method should only accept module namespace objects
+        https://bugs.webkit.org/show_bug.cgi?id=161097
+
+        Reviewed by Keith Miller.
+
+        * test262.yaml:
+
 2016-08-22  Yusuke Suzuki  <[email protected]>
 
         [ES6] Modules' `export default function/class` should be declaration

Modified: trunk/JSTests/test262.yaml (204847 => 204848)


--- trunk/JSTests/test262.yaml	2016-08-23 19:02:48 UTC (rev 204847)
+++ trunk/JSTests/test262.yaml	2016-08-23 19:07:33 UTC (rev 204848)
@@ -71254,7 +71254,7 @@
 - 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
-  cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:module]
+  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:module]
 - path: test262/test/language/module-code/namespace/Symbol.iterator/values-binding-types.js
   cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:module]
 - path: test262/test/language/module-code/namespace/Symbol.iterator/values-binding-types_.js

Modified: trunk/Source/_javascript_Core/ChangeLog (204847 => 204848)


--- trunk/Source/_javascript_Core/ChangeLog	2016-08-23 19:02:48 UTC (rev 204847)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-08-23 19:07:33 UTC (rev 204848)
@@ -1,3 +1,13 @@
+2016-08-23  Yusuke Suzuki  <[email protected]>
+
+        [ES6] Module namespace object's Symbol.iterator method should only accept module namespace objects
+        https://bugs.webkit.org/show_bug.cgi?id=161097
+
+        Reviewed by Keith Miller.
+
+        * runtime/JSModuleNamespaceObject.cpp:
+        (JSC::moduleNamespaceObjectSymbolIterator):
+
 2016-08-22  Yusuke Suzuki  <[email protected]>
 
         [ES6] Modules' `export default function/class` should be declaration

Modified: trunk/Source/_javascript_Core/runtime/JSModuleNamespaceObject.cpp (204847 => 204848)


--- trunk/Source/_javascript_Core/runtime/JSModuleNamespaceObject.cpp	2016-08-23 19:02:48 UTC (rev 204847)
+++ trunk/Source/_javascript_Core/runtime/JSModuleNamespaceObject.cpp	2016-08-23 19:07:33 UTC (rev 204848)
@@ -201,10 +201,10 @@
 
 EncodedJSValue JSC_HOST_CALL moduleNamespaceObjectSymbolIterator(ExecState* exec)
 {
-    JSValue thisValue = exec->thisValue();
-    if (!thisValue.isObject())
-        return JSValue::encode(throwTypeError(exec, ASCIILiteral("|this| should be an object")));
-    return JSValue::encode(JSPropertyNameIterator::create(exec, exec->lexicalGlobalObject()->propertyNameIteratorStructure(), asObject(thisValue)));
+    JSModuleNamespaceObject* object = jsDynamicCast<JSModuleNamespaceObject*>(exec->thisValue());
+    if (!object)
+        return throwVMTypeError(exec, ASCIILiteral("|this| should be a module namespace object"));
+    return JSValue::encode(JSPropertyNameIterator::create(exec, exec->lexicalGlobalObject()->propertyNameIteratorStructure(), object));
 }
 
 } // namespace JSC
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to