mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Stop passing the scope argument to global object bindings' Wrap functions.
This commit is contained in:
parent
12380edc63
commit
b6138580d3
2 changed files with 7 additions and 6 deletions
|
@ -2599,8 +2599,12 @@ def CreateBindingJSObject(descriptor, parent=None):
|
||||||
class CGWrapMethod(CGAbstractMethod):
|
class CGWrapMethod(CGAbstractMethod):
|
||||||
def __init__(self, descriptor):
|
def __init__(self, descriptor):
|
||||||
assert descriptor.interface.hasInterfacePrototypeObject()
|
assert descriptor.interface.hasInterfacePrototypeObject()
|
||||||
|
if not descriptor.createGlobal:
|
||||||
args = [Argument('*JSContext', 'aCx'), Argument('*JSObject', 'aScope'),
|
args = [Argument('*JSContext', 'aCx'), Argument('*JSObject', 'aScope'),
|
||||||
Argument(DOMObjectPointerArg(descriptor), 'aObject', mutable=True)]
|
Argument(DOMObjectPointerArg(descriptor), 'aObject', mutable=True)]
|
||||||
|
else:
|
||||||
|
args = [Argument('*JSContext', 'aCx'),
|
||||||
|
Argument(DOMObjectPointerArg(descriptor), 'aObject', mutable=True)]
|
||||||
CGAbstractMethod.__init__(self, descriptor, 'Wrap', '*JSObject', args, pub=True)
|
CGAbstractMethod.__init__(self, descriptor, 'Wrap', '*JSObject', args, pub=True)
|
||||||
|
|
||||||
def definition_body(self):
|
def definition_body(self):
|
||||||
|
@ -2622,8 +2626,6 @@ class CGWrapMethod(CGAbstractMethod):
|
||||||
return obj;""" % CreateBindingJSObject(self.descriptor, "aScope")
|
return obj;""" % CreateBindingJSObject(self.descriptor, "aScope")
|
||||||
else:
|
else:
|
||||||
return """
|
return """
|
||||||
assert!(aScope.is_null());
|
|
||||||
|
|
||||||
%s
|
%s
|
||||||
let proto = GetProtoObject(aCx, obj, obj);
|
let proto = GetProtoObject(aCx, obj, obj);
|
||||||
JS_SetPrototype(aCx, obj, proto);
|
JS_SetPrototype(aCx, obj, proto);
|
||||||
|
|
|
@ -29,7 +29,6 @@ use std::comm::Select;
|
||||||
use std::hashmap::HashSet;
|
use std::hashmap::HashSet;
|
||||||
use std::io::timer::Timer;
|
use std::io::timer::Timer;
|
||||||
use std::num;
|
use std::num;
|
||||||
use std::ptr;
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::to_bytes::Cb;
|
use std::to_bytes::Cb;
|
||||||
|
|
||||||
|
@ -311,7 +310,7 @@ impl Window {
|
||||||
};
|
};
|
||||||
|
|
||||||
let raw: *mut Window = &mut *win;
|
let raw: *mut Window = &mut *win;
|
||||||
let global = WindowBinding::Wrap(cx, ptr::null(), win);
|
let global = WindowBinding::Wrap(cx, win);
|
||||||
assert!(global.is_not_null());
|
assert!(global.is_not_null());
|
||||||
unsafe {
|
unsafe {
|
||||||
let fn_names = ["window","self"];
|
let fn_names = ["window","self"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue