Add explicit JSGlobalThis type.
https://bugs.webkit.org/show_bug.cgi?id=69478
Reviewed by Darin Adler.
JSC supports a split global object, as used by WebCore for the Window. As a stage
of making this visible to JSC, make it so that if the global this value is not the
global object itself, it must be a subclass of JSGlobalThis.
Source/JavaScriptCore:
- API/JSCallbackObjectFunctions.h:
(JSC::::finishCreation):
- Don't pass the thisValue to JSGlobalObject::finishCreation.
(GlobalObject::finishCreation):
- Don't pass the thisValue to JSGlobalObject::finishCreation.
- runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::create):
(JSC::JSGlobalObject::finishCreation):
- finishCreation takes a JSGlobalThis, or thisValue is implicit.
- runtime/JSGlobalThis.h: Added.
(JSC::JSGlobalThis::create):
(JSC::JSGlobalThis::JSGlobalThis):
(JSC::JSGlobalThis::finishCreation):
- Thin wrapper on JSNonFinalObject to allow type checking.
(GlobalObject::finishCreation):
- Don't pass the thisValue to JSGlobalObject::finishCreation.
Source/JavaScriptGlue:
(JSGlueGlobalObject::create):
- Don't pass the thisValue to JSGlobalObject::finishCreation.
Source/WebCore:
- ForwardingHeaders/runtime/JSGlobalThis.h: Added.
- bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::finishCreation):
- bindings/js/JSDOMGlobalObject.h:
- finishCreation takes a JSGlobalThis, or thisValue is implicit.
- bindings/js/JSDOMWindowShell.h:
- Make the window shell a subclass of JSGlobalThis.
- bindings/js/JSWorkerContextBase.cpp:
(WebCore::JSWorkerContextBase::finishCreation):
- Don't pass the thisValue to JSGlobalObject::finishCreation.
- bindings/js/JSWorkerContextBase.h:
- bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
- Don't pass the thisValue to JSGlobalObject::finishCreation,
for worker contexts.