Changeset 212710 in webkit


Ignore:
Timestamp:
Feb 21, 2017 1:07:41 AM (7 years ago)
Author:
Yusuke Suzuki
Message:

ASSERTION FAILED: "!scope.exception()" with Object.isSealed/isFrozen and uninitialized module bindings
https://bugs.webkit.org/show_bug.cgi?id=168605

Reviewed by Saam Barati.

JSTests:

  • modules/module-namespace-is-frozen.js: Added.

(from.string_appeared_here.shouldThrow):
(export.b):

  • modules/module-namespace-is-sealed.js: Added.

(from.string_appeared_here.shouldThrow):
(export.b):

Source/JavaScriptCore:

We should check exception state after calling getOwnPropertyDescriptor() since it can throw errors.

  • runtime/ObjectConstructor.cpp:

(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r212616 r212710  
     12017-02-21  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        ASSERTION FAILED: "!scope.exception()" with Object.isSealed/isFrozen and uninitialized module bindings
     4        https://bugs.webkit.org/show_bug.cgi?id=168605
     5
     6        Reviewed by Saam Barati.
     7
     8        * modules/module-namespace-is-frozen.js: Added.
     9        (from.string_appeared_here.shouldThrow):
     10        (export.b):
     11        * modules/module-namespace-is-sealed.js: Added.
     12        (from.string_appeared_here.shouldThrow):
     13        (export.b):
     14
    1152017-02-19  Commit Queue  <commit-queue@webkit.org>
    216
  • trunk/Source/JavaScriptCore/ChangeLog

    r212692 r212710  
     12017-02-21  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        ASSERTION FAILED: "!scope.exception()" with Object.isSealed/isFrozen and uninitialized module bindings
     4        https://bugs.webkit.org/show_bug.cgi?id=168605
     5
     6        Reviewed by Saam Barati.
     7
     8        We should check exception state after calling getOwnPropertyDescriptor() since it can throw errors.
     9
     10        * runtime/ObjectConstructor.cpp:
     11        (JSC::objectConstructorIsSealed):
     12        (JSC::objectConstructorIsFrozen):
     13
    1142017-02-20  Mark Lam  <mark.lam@apple.com>
    215
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp

    r211247 r212710  
    632632    PropertyNameArray properties(exec, PropertyNameMode::StringsAndSymbols);
    633633    object->methodTable(vm)->getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
    634     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     634    RETURN_IF_EXCEPTION(scope, { });
    635635    PropertyNameArray::const_iterator end = properties.end();
    636636    for (PropertyNameArray::const_iterator iter = properties.begin(); iter != end; ++iter) {
     
    640640        // a. Let desc be the result of calling the [[GetOwnProperty]] internal method of O with P.
    641641        PropertyDescriptor desc;
    642         if (!object->getOwnPropertyDescriptor(exec, propertyName, desc))
     642        bool didGetDescriptor = object->getOwnPropertyDescriptor(exec, propertyName, desc);
     643        RETURN_IF_EXCEPTION(scope, { });
     644        if (!didGetDescriptor)
    643645            continue;
    644646        // b. If desc.[[Configurable]] is true, then return false.
     
    650652    // 4. Otherwise, return false.
    651653    bool isExtensible = object->isExtensible(exec);
    652     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     654    RETURN_IF_EXCEPTION(scope, { });
    653655    return JSValue::encode(jsBoolean(!isExtensible));
    654656}
     
    671673    PropertyNameArray properties(exec, PropertyNameMode::StringsAndSymbols);
    672674    object->methodTable(vm)->getOwnPropertyNames(object, exec, properties, EnumerationMode(DontEnumPropertiesMode::Include));
    673     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     675    RETURN_IF_EXCEPTION(scope, { });
    674676    PropertyNameArray::const_iterator end = properties.end();
    675677    for (PropertyNameArray::const_iterator iter = properties.begin(); iter != end; ++iter) {
     
    679681        // a. Let desc be the result of calling the [[GetOwnProperty]] internal method of O with P.
    680682        PropertyDescriptor desc;
    681         if (!object->getOwnPropertyDescriptor(exec, propertyName, desc))
     683        bool didGetDescriptor = object->getOwnPropertyDescriptor(exec, propertyName, desc);
     684        RETURN_IF_EXCEPTION(scope, { });
     685        if (!didGetDescriptor)
    682686            continue;
    683687        // b. If IsDataDescriptor(desc) is true then
     
    690694    // 4. Otherwise, return false.
    691695    bool isExtensible = object->isExtensible(exec);
    692     RETURN_IF_EXCEPTION(scope, encodedJSValue());
     696    RETURN_IF_EXCEPTION(scope, { });
    693697    return JSValue::encode(jsBoolean(!isExtensible));
    694698}
Note: See TracChangeset for help on using the changeset viewer.