Changeset 207852 in webkit


Ignore:
Timestamp:
Oct 25, 2016 3:41:09 PM (8 years ago)
Author:
jfbastien@apple.com
Message:

Remove redundant argument count check

Indexing argument out of bounds already returns jsUndefined().

Remove redundant argument count check
https://bugs.webkit.org/show_bug.cgi?id=163957

Reviewed by Keith Miller.

  • runtime/ErrorConstructor.cpp:

(JSC::Interpreter::constructWithErrorConstructor):
(JSC::Interpreter::callErrorConstructor):

  • wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:

(JSC::constructJSWebAssemblyRuntimeError):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r207851 r207852  
     12016-10-25  JF Bastien  <jfbastien@apple.com>
     2
     3        Remove redundant argument count check
     4
     5        Indexing argument out of bounds already returns jsUndefined().
     6
     7        Remove redundant argument count check
     8        https://bugs.webkit.org/show_bug.cgi?id=163957
     9
     10        Reviewed by Keith Miller.
     11
     12        * runtime/ErrorConstructor.cpp:
     13        (JSC::Interpreter::constructWithErrorConstructor):
     14        (JSC::Interpreter::callErrorConstructor):
     15        * wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
     16        (JSC::constructJSWebAssemblyRuntimeError):
     17
    1182016-10-25  Mark Lam  <mark.lam@apple.com>
    219
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp

    r206386 r207852  
    5353    VM& vm = exec->vm();
    5454    auto scope = DECLARE_THROW_SCOPE(vm);
    55     JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     55    JSValue message = exec->argument(0);
    5656    Structure* errorStructure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), asInternalFunction(exec->callee())->globalObject()->errorStructure());
    5757    RETURN_IF_EXCEPTION(scope, encodedJSValue());
     
    6767EncodedJSValue JSC_HOST_CALL Interpreter::callErrorConstructor(ExecState* exec)
    6868{
    69     JSValue message = exec->argumentCount() ? exec->argument(0) : jsUndefined();
     69    JSValue message = exec->argument(0);
    7070    Structure* errorStructure = asInternalFunction(exec->callee())->globalObject()->errorStructure();
    7171    return JSValue::encode(ErrorInstance::create(exec, errorStructure, message, nullptr, TypeNothing, false));
  • trunk/Source/JavaScriptCore/wasm/js/WebAssemblyRuntimeErrorConstructor.cpp

    r207825 r207852  
    4949    auto& vm = state->vm();
    5050    auto scope = DECLARE_THROW_SCOPE(vm);
    51     JSValue message = state->argumentCount() ? state->argument(0) : jsUndefined();
     51    JSValue message = state->argument(0);
    5252    auto* structure = InternalFunction::createSubclassStructure(state, state->newTarget(), asInternalFunction(state->callee())->globalObject()->WebAssemblyRuntimeErrorStructure());
    5353    RETURN_IF_EXCEPTION(scope, encodedJSValue());
Note: See TracChangeset for help on using the changeset viewer.