Ignore:
Timestamp:
Mar 28, 2011, 4:39:16 PM (14 years ago)
Author:
[email protected]
Message:

2011-03-28 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

instanceof Array test fails when using iframes
https://bugs.webkit.org/show_bug.cgi?id=17250

Add test cases for correct behaviour

  • fast/js/js-constructors-use-correct-global-expected.txt: Added.
  • fast/js/js-constructors-use-correct-global.html: Added.
  • fast/js/resources/js-constructors-use-correct-global.js: Added.

2011-03-28 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

instanceof Array test fails when using iframes
https://bugs.webkit.org/show_bug.cgi?id=17250

This is a problem with all built in constructors, the use of
lexicalGlobalObject rather than the constructors own
global object reference means that a builtin will always use
the prototype from the lexical global object rather than that
of the constructors origin.

  • API/JSObjectRef.cpp: (JSObjectMakeFunction): (JSObjectMakeRegExp):
  • JavaScriptCore.exp:
  • runtime/ArrayConstructor.cpp: (JSC::constructArrayWithSizeQuirk):
  • runtime/BooleanConstructor.cpp: (JSC::constructBoolean): (JSC::constructBooleanFromImmediateBoolean):
  • runtime/BooleanConstructor.h:
  • runtime/DateConstructor.cpp: (JSC::constructDate):
  • runtime/DateInstance.cpp:
  • runtime/DateInstance.h:
  • runtime/ErrorConstructor.cpp: (JSC::constructWithErrorConstructor): (JSC::callErrorConstructor):
  • runtime/FunctionConstructor.cpp: (JSC::constructWithFunctionConstructor): (JSC::callFunctionConstructor): (JSC::constructFunction):
  • runtime/FunctionConstructor.h:
  • runtime/JSCell.cpp: (JSC::JSCell::getOwnPropertySlot): (JSC::JSCell::put): (JSC::JSCell::deleteProperty): (JSC::JSCell::toThisObject): (JSC::JSCell::toObject):
  • runtime/JSCell.h: (JSC::JSCell::JSValue::toObject):
  • runtime/JSNotAnObject.cpp: (JSC::JSNotAnObject::toObject):
  • runtime/JSNotAnObject.h:
  • runtime/JSObject.cpp: (JSC::JSObject::toObject):
  • runtime/JSObject.h:
  • runtime/JSString.cpp: (JSC::StringObject::create): (JSC::JSString::toObject): (JSC::JSString::toThisObject):
  • runtime/JSString.h:
  • runtime/JSValue.cpp: (JSC::JSValue::toObjectSlowCase): (JSC::JSValue::toThisObjectSlowCase): (JSC::JSValue::synthesizeObject):
  • runtime/JSValue.h:
  • runtime/NumberConstructor.cpp: (JSC::constructWithNumberConstructor):
  • runtime/NumberObject.cpp: (JSC::constructNumber):
  • runtime/NumberObject.h:
  • runtime/ObjectConstructor.cpp: (JSC::constructObject): (JSC::constructWithObjectConstructor): (JSC::callObjectConstructor):
  • runtime/RegExpConstructor.cpp: (JSC::constructRegExp): (JSC::constructWithRegExpConstructor): (JSC::callRegExpConstructor):
  • runtime/RegExpConstructor.h:
  • runtime/StringConstructor.cpp: (JSC::constructWithStringConstructor):
  • runtime/StringObject.h:

2011-03-25 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

instanceof Array test fails when using iframes
https://bugs.webkit.org/show_bug.cgi?id=17250

Up date for new toObject api

  • UserObjectImp.cpp: (UserObjectImp::toPrimitive): (UserObjectImp::toBoolean): (UserObjectImp::toNumber): (UserObjectImp::toString):

2011-03-28 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

instanceof Array test fails when using iframes
https://bugs.webkit.org/show_bug.cgi?id=17250

Update for new function and date apis

Test: fast/js/js-constructors-use-correct-global.html

  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSDOMBinding.cpp: (WebCore::jsDateOrNull):
  • bindings/js/JSLazyEventListener.cpp: (WebCore::JSLazyEventListener::initializeJSFunction):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r79132 r82173  
    125125    args.append(jsString(exec, body->ustring()));
    126126
    127     JSObject* result = constructFunction(exec, args, nameID, sourceURL->ustring(), startingLineNumber);
     127    JSObject* result = constructFunction(exec, exec->lexicalGlobalObject(), args, nameID, sourceURL->ustring(), startingLineNumber);
    128128    if (exec->hadException()) {
    129129        if (exception)
     
    208208        argList.append(toJS(exec, arguments[i]));
    209209
    210     JSObject* result = constructRegExp(exec, argList);
     210    JSObject* result = constructRegExp(exec, exec->lexicalGlobalObject(),  argList);
    211211    if (exec->hadException()) {
    212212        if (exception)
Note: See TracChangeset for help on using the changeset viewer.