Ignore:
Timestamp:
Sep 28, 2017, 11:09:09 AM (8 years ago)
Author:
[email protected]
Message:

Add missing exception checks and book-keeping for exception check validation.
https://bugs.webkit.org/show_bug.cgi?id=177609
<rdar://problem/34717972>

Reviewed by Keith Miller.

This resolves exception check validation failures when running test262 tests and
a few other tests.

  • API/APIUtils.h:

(handleExceptionIfNeeded):

  • API/JSObjectRef.cpp:

(JSObjectMakeFunction):
(JSObjectMakeArray):
(JSObjectMakeDate):
(JSObjectMakeError):
(JSObjectMakeRegExp):
(JSObjectSetPrototype):
(JSObjectGetProperty):
(JSObjectSetProperty):
(JSObjectGetPropertyAtIndex):
(JSObjectSetPropertyAtIndex):
(JSObjectDeleteProperty):
(JSObjectCallAsFunction):
(JSObjectCallAsConstructor):

  • API/JSTypedArray.cpp:

(JSObjectMakeTypedArray):
(JSObjectMakeTypedArrayWithBytesNoCopy):
(JSObjectMakeTypedArrayWithArrayBuffer):
(JSObjectMakeTypedArrayWithArrayBufferAndOffset):
(JSObjectMakeArrayBufferWithBytesNoCopy):

  • API/JSValueRef.cpp:

(JSValueIsEqual):
(JSValueIsInstanceOfConstructor):
(JSValueCreateJSONString):
(JSValueToNumber):
(JSValueToStringCopy):
(JSValueToObject):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::executeProgram):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • runtime/ArrayPrototype.cpp:

(JSC::arrayProtoFuncIndexOf):
(JSC::arrayProtoFuncLastIndexOf):

  • runtime/DatePrototype.cpp:

(JSC::fillStructuresUsingTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetYear):

  • runtime/JSGenericTypedArrayViewConstructorInlines.h:

(JSC::constructGenericTypedArrayViewWithArguments):

  • runtime/JSModuleEnvironment.cpp:

(JSC::JSModuleEnvironment::put):

  • runtime/ProgramExecutable.cpp:

(JSC::ProgramExecutable::initializeGlobalProperties):

  • runtime/ProxyObject.cpp:

(JSC::ProxyObject::toStringName):

  • runtime/StringPrototype.cpp:

(JSC::stringProtoFuncCharAt):
(JSC::stringProtoFuncCharCodeAt):
(JSC::stringProtoFuncIndexOf):
(JSC::stringProtoFuncLastIndexOf):
(JSC::stringProtoFuncSlice):
(JSC::stringProtoFuncSplitFast):
(JSC::stringProtoFuncSubstr):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/ProgramExecutable.cpp

    r222473 r222617  
    131131        for (auto& entry : lexicalDeclarations) {
    132132            // The ES6 spec says that RestrictedGlobalProperty can't be shadowed.
    133             if (hasRestrictedGlobalProperty(exec, globalObject, entry.key.get()))
     133            bool hasProperty = hasRestrictedGlobalProperty(exec, globalObject, entry.key.get());
     134            RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
     135            if (hasProperty)
    134136                return createSyntaxError(exec, makeString("Can't create duplicate variable that shadows a global property: '", String(entry.key.get()), "'"));
    135137
    136             bool hasProperty = globalLexicalEnvironment->hasProperty(exec, entry.key.get());
     138            hasProperty = globalLexicalEnvironment->hasProperty(exec, entry.key.get());
    137139            RETURN_IF_EXCEPTION(throwScope, throwScope.exception());
    138140            if (hasProperty) {
Note: See TracChangeset for help on using the changeset viewer.