Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend WrapperNew. #182

Merged
merged 1 commit into from Aug 11, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Extend WrapperNew.

  • Loading branch information
Ms2ger committed Aug 11, 2015
commit e9ec9cecd294cd27f7d0f233f4e6dace8ad4e2aa
@@ -202,7 +202,8 @@ extern "C" {
call: *mut JSObject, construct: *mut JSObject)
-> *mut JSObject;
pub fn WrapperNew(aCx: *mut JSContext, aObj: HandleObject,
aHandler: *const ::libc::c_void)
aHandler: *const ::libc::c_void, aClass: *const JSClass,
aSingleton: bool)
-> *mut JSObject;
pub fn GetProxyExtra(obj: *mut JSObject, slot: u32) -> Value;
pub fn GetProxyPrivate(obj: *mut JSObject) -> Value;
@@ -508,9 +508,15 @@ NewProxyObject(JSContext* aCx, const void* aHandler, JS::HandleValue aPriv,
}

JSObject*
WrapperNew(JSContext* aCx, JS::HandleObject aObj, const void* aHandler)
WrapperNew(JSContext* aCx, JS::HandleObject aObj, const void* aHandler,
const JSClass* aClass, bool aSingleton)
{
return js::Wrapper::New(aCx, aObj, (const js::Wrapper*)aHandler);
js::WrapperOptions options;
if (aClass) {
options.setClass(js::Valueify(aClass));
}
options.setSingleton(aSingleton);
return js::Wrapper::New(aCx, aObj, (const js::Wrapper*)aHandler, options);
}

jsval
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.