mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Upgrade rust.
This commit is contained in:
parent
7ece5f92db
commit
31eee791dd
102 changed files with 724 additions and 839 deletions
|
@ -2023,7 +2023,7 @@ def CreateBindingJSObject(descriptor, parent=None):
|
|||
assert not descriptor.createGlobal
|
||||
handler = """
|
||||
let js_info = aScope.get().page().js_info();
|
||||
let handler = js_info.get().get_ref().dom_static.proxy_handlers.get(&(PrototypeList::id::%s as uint));
|
||||
let handler = js_info.get_ref().dom_static.proxy_handlers.get(&(PrototypeList::id::%s as uint));
|
||||
""" % descriptor.name
|
||||
create += handler + """ let obj = NewProxyObject(aCx, *handler,
|
||||
&PrivateValue(squirrel_away_unique(aObject) as *libc::c_void),
|
||||
|
@ -2338,12 +2338,12 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
|
|||
self.descriptor.name)
|
||||
else:
|
||||
body += """ js_info.dom_static.attribute_ids.insert(PrototypeList::id::%s as uint,
|
||||
vec::cast_to_mut(vec::from_slice(sAttributes_ids)));
|
||||
slice::cast_to_mut(slice::from_slice(sAttributes_ids)));
|
||||
""" % self.descriptor.name
|
||||
body = "" #XXXjdm xray stuff isn't necessary yet
|
||||
|
||||
return (body + """ let cx = js_info.js_context.borrow().ptr;
|
||||
let receiver = js_info.js_compartment.borrow().global_obj;
|
||||
return (body + """ let cx = js_info.js_context.deref().ptr;
|
||||
let receiver = js_info.js_compartment.global_obj;
|
||||
let global: *JSObject = JS_GetGlobalForObject(cx, receiver);
|
||||
return %s(cx, global, receiver).is_not_null();""" % (getter))
|
||||
|
||||
|
@ -3700,7 +3700,7 @@ class CGXrayHelper(CGAbstractExternMethod):
|
|||
methods = self.properties.methods
|
||||
if methods.hasNonChromeOnly() or methods.hasChromeOnly():
|
||||
methodArgs = "Some(zip_copies(%(methods)s, *method_ids))" % varNames
|
||||
setup += "let method_ids = js_info.get().get_ref().dom_static.method_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
|
||||
setup += "let method_ids = js_info.get_ref().dom_static.method_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
|
||||
else:
|
||||
methodArgs = "None"
|
||||
methodArgs = CGGeneric(methodArgs)
|
||||
|
@ -3708,7 +3708,7 @@ class CGXrayHelper(CGAbstractExternMethod):
|
|||
attrs = self.properties.attrs
|
||||
if attrs.hasNonChromeOnly() or attrs.hasChromeOnly():
|
||||
attrArgs = "Some(zip_copies(%(attrs)s, *attr_ids))" % varNames
|
||||
setup += "let attr_ids = js_info.get().get_ref().dom_static.attribute_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
|
||||
setup += "let attr_ids = js_info.get_ref().dom_static.attribute_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
|
||||
else:
|
||||
attrArgs = "None"
|
||||
attrArgs = CGGeneric(attrArgs)
|
||||
|
@ -3716,7 +3716,7 @@ class CGXrayHelper(CGAbstractExternMethod):
|
|||
consts = self.properties.consts
|
||||
if consts.hasNonChromeOnly() or consts.hasChromeOnly():
|
||||
constArgs = "Some(zip_copies(%(consts)s, *const_ids))" % varNames
|
||||
setup += "let const_ids = js_info.get().get_ref().dom_static.constant_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
|
||||
setup += "let const_ids = js_info.get_ref().dom_static.constant_ids.get(&(PrototypeList::id::ClientRect as uint));\n"
|
||||
else:
|
||||
constArgs = "None"
|
||||
constArgs = CGGeneric(constArgs)
|
||||
|
@ -4774,7 +4774,7 @@ class CGBindingRoot(CGThing):
|
|||
'std::cmp',
|
||||
'std::libc',
|
||||
'std::ptr',
|
||||
'std::vec',
|
||||
'std::slice',
|
||||
'std::str',
|
||||
'std::num',
|
||||
])
|
||||
|
@ -5336,7 +5336,7 @@ class CallbackMember(CGNativeMember):
|
|||
if self.argCount > 0:
|
||||
replacements["argCount"] = self.argCountStr
|
||||
replacements["argvDecl"] = string.Template(
|
||||
"let mut argv = vec::from_elem(${argCount}, UndefinedValue());\n"
|
||||
"let mut argv = slice::from_elem(${argCount}, UndefinedValue());\n"
|
||||
).substitute(replacements)
|
||||
else:
|
||||
# Avoid weird 0-sized arrays
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue