Ignore:
Timestamp:
Sep 26, 2012, 3:50:27 PM (13 years ago)
Author:
[email protected]
Message:

Proxy the global this in JSC
https://bugs.webkit.org/show_bug.cgi?id=97734

Reviewed by Oliver Hunt.

Having jsc diverge from WebCore here is not beneficial; it potentially masks bugs and/or performance
problems from command line testing.

  • jsc.cpp:

(GlobalObject::create):

  • Create a this value proxy for the global object.
  • runtime/JSGlobalObject.h:

(JSGlobalObject):

  • Make setGlobalThis protected.
  • runtime/JSProxy.h:

(JSC::JSProxy::create):
(JSC::JSProxy::target):
(JSC::JSProxy::finishCreation):
(JSProxy):

  • Allow proxy target to be a JSObject, add target to create method.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r128851 r129711  
    3434#include "JSFunction.h"
    3535#include "JSLock.h"
     36#include "JSProxy.h"
    3637#include "JSString.h"
    3738#include "SamplingTool.h"
     
    177178        GlobalObject* object = new (NotNull, allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
    178179        object->finishCreation(globalData, arguments);
     180        object->setGlobalThis(globalData, JSProxy::create(globalData, JSProxy::createStructure(globalData, object), object));
    179181        return object;
    180182    }
Note: See TracChangeset for help on using the changeset viewer.