Ignore:
Timestamp:
Mar 4, 2015, 8:25:49 PM (10 years ago)
Author:
Yusuke Suzuki
Message:

Hide Promise with runtime flags under Cocoa JSContext API
https://bugs.webkit.org/show_bug.cgi?id=141965

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Since there's no run loop in JavaScriptCore APIs, Promises don't work currently.
So until they work, we hide Promise from a global object.
Introduce new JSC runtime flag, PromiseDisabled. When isPromiseDisabled is true,
Promise constructor is not attached to JSGlobalObject.

To make 0 as default runtime flags, we choose PromiseDisabled flag
instead of PromiseEnabled flag. So by default, Promise is enabled.

  • API/JSCallbackObjectFunctions.h:

(JSC::JSCallbackObject<Parent>::JSCallbackObject):

  • API/JSContextRef.cpp:

(javaScriptRuntimeFlags):
(JSGlobalContextCreateInGroup):

  • API/tests/testapi.c:

(main):

  • API/tests/testapi.mm:

(testObjectiveCAPI):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::create):

  • runtime/RuntimeFlags.h:

(JSC::RuntimeFlags::createAllEnabled):

Source/WebKit/mac:

Add new JSC runtime flag, PromiseDisabled.

  • WebView/WebPreferencesPrivate.h:

Source/WebKit/win:

Add new JSC runtime flag, PromiseDisabled.

  • Interfaces/IWebPreferences.idl:
  • Interfaces/IWebPreferencesPrivate.idl:

Source/WebKit2:

Add new JSC runtime flag, PromiseDisabled.

  • UIProcess/API/C/WKPreferencesRefPrivate.h:
  • UIProcess/API/Cocoa/WKPreferencesPrivate.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r172176 r181064  
    6363}
    6464
     65extern const GlobalObjectMethodTable javaScriptCoreAPIGlobalObjectMethodTable;
     66
    6567// Global object constructor.
    6668// FIXME: Move this into a separate JSGlobalCallbackObject class derived from this one.
    6769template <class Parent>
    6870JSCallbackObject<Parent>::JSCallbackObject(VM& vm, JSClassRef jsClass, Structure* structure)
    69     : Parent(vm, structure)
     71    : Parent(vm, structure, &javaScriptCoreAPIGlobalObjectMethodTable)
    7072    , m_callbackObjectData(adoptPtr(new JSCallbackObjectData(0, jsClass)))
    7173{
Note: See TracChangeset for help on using the changeset viewer.