Ignore:
Timestamp:
Feb 19, 2009, 12:35:55 PM (16 years ago)
Author:
[email protected]
Message:

2009-02-18 Geoffrey Garen <[email protected]>

Reviewed by Oliver Hunt.


Simplified .call and .apply in preparation for optimizing them. Also,
a little cleanup.

  • runtime/FunctionPrototype.cpp: (JSC::functionProtoFuncApply): (JSC::functionProtoFuncCall): No need to do any specific conversion on 'this' -- op_convert_this will do it if necessary.
  • runtime/JSImmediate.cpp: (JSC::JSImmediate::toThisObject): Slightly relaxed the rules on toThisObject to allow for 'undefined', which can be passed through .call and .apply.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSImmediate.cpp

    r40046 r41083  
    4040    if (isBoolean(v))
    4141        return constructBooleanFromImmediateBoolean(exec, v);
    42     if (v.isNull())
    43         return exec->globalThisValue();
    44    
    45     JSNotAnObjectErrorStub* exception = createNotAnObjectErrorStub(exec, v.isNull());
    46     exec->setException(exception);
    47     return new (exec) JSNotAnObject(exec, exception);
     42    ASSERT(v.isUndefinedOrNull());
     43    return exec->globalThisValue();
    4844}
    4945
Note: See TracChangeset for help on using the changeset viewer.