mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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):
|
||||
def __init__(self, descriptor):
|
||||
assert descriptor.interface.hasInterfacePrototypeObject()
|
||||
args = [Argument('*JSContext', 'aCx'), Argument('*JSObject', 'aScope'),
|
||||
Argument(DOMObjectPointerArg(descriptor), 'aObject', mutable=True)]
|
||||
if not descriptor.createGlobal:
|
||||
args = [Argument('*JSContext', 'aCx'), Argument('*JSObject', 'aScope'),
|
||||
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)
|
||||
|
||||
def definition_body(self):
|
||||
|
@ -2622,8 +2626,6 @@ class CGWrapMethod(CGAbstractMethod):
|
|||
return obj;""" % CreateBindingJSObject(self.descriptor, "aScope")
|
||||
else:
|
||||
return """
|
||||
assert!(aScope.is_null());
|
||||
|
||||
%s
|
||||
let proto = GetProtoObject(aCx, obj, obj);
|
||||
JS_SetPrototype(aCx, obj, proto);
|
||||
|
|
|
@ -29,7 +29,6 @@ use std::comm::Select;
|
|||
use std::hashmap::HashSet;
|
||||
use std::io::timer::Timer;
|
||||
use std::num;
|
||||
use std::ptr;
|
||||
use std::rc::Rc;
|
||||
use std::to_bytes::Cb;
|
||||
|
||||
|
@ -311,7 +310,7 @@ impl Window {
|
|||
};
|
||||
|
||||
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());
|
||||
unsafe {
|
||||
let fn_names = ["window","self"];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue