Changeset 204848 in webkit


Ignore:
Timestamp:
Aug 23, 2016, 12:07:33 PM (9 years ago)
Author:
Yusuke Suzuki
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/JavaScriptCore:

  • runtime/JSModuleNamespaceObject.cpp:

(JSC::moduleNamespaceObjectSymbolIterator):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r204842 r204848  
     12016-08-23  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [ES6] Module namespace object's Symbol.iterator method should only accept module namespace objects
     4        https://bugs.webkit.org/show_bug.cgi?id=161097
     5
     6        Reviewed by Keith Miller.
     7
     8        * test262.yaml:
     9
    1102016-08-22  Yusuke Suzuki  <utatane.tea@gmail.com>
    211
  • trunk/JSTests/test262.yaml

    r204842 r204848  
    7125571255  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:module]
    7125671256- path: test262/test/language/module-code/namespace/Symbol.iterator/this-val-not-ns.js
    71257   cmd: runTest262 :fail, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:module]
     71257  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:module]
    7125871258- path: test262/test/language/module-code/namespace/Symbol.iterator/values-binding-types.js
    7125971259  cmd: runTest262 :normal, "NoException", ["../../../../../harness/assert.js", "../../../../../harness/sta.js"], [:module]
  • trunk/Source/JavaScriptCore/ChangeLog

    r204842 r204848  
     12016-08-23  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [ES6] Module namespace object's Symbol.iterator method should only accept module namespace objects
     4        https://bugs.webkit.org/show_bug.cgi?id=161097
     5
     6        Reviewed by Keith Miller.
     7
     8        * runtime/JSModuleNamespaceObject.cpp:
     9        (JSC::moduleNamespaceObjectSymbolIterator):
     10
    1112016-08-22  Yusuke Suzuki  <utatane.tea@gmail.com>
    212
  • trunk/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp

    r204248 r204848  
    202202EncodedJSValue JSC_HOST_CALL moduleNamespaceObjectSymbolIterator(ExecState* exec)
    203203{
    204     JSValue thisValue = exec->thisValue();
    205     if (!thisValue.isObject())
    206         return JSValue::encode(throwTypeError(exec, ASCIILiteral("|this| should be an object")));
    207     return JSValue::encode(JSPropertyNameIterator::create(exec, exec->lexicalGlobalObject()->propertyNameIteratorStructure(), asObject(thisValue)));
     204    JSModuleNamespaceObject* object = jsDynamicCast<JSModuleNamespaceObject*>(exec->thisValue());
     205    if (!object)
     206        return throwVMTypeError(exec, ASCIILiteral("|this| should be a module namespace object"));
     207    return JSValue::encode(JSPropertyNameIterator::create(exec, exec->lexicalGlobalObject()->propertyNameIteratorStructure(), object));
    208208}
    209209
Note: See TracChangeset for help on using the changeset viewer.