aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/bindings/codegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/script/dom/bindings/codegen')
-rw-r--r--src/components/script/dom/bindings/codegen/CodegenRust.py12
-rw-r--r--src/components/script/dom/bindings/codegen/GlobalGen.py16
2 files changed, 13 insertions, 15 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index 62cb66d5f1f..171301ac7d4 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -641,7 +641,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
default = "None"
else:
assert defaultValue.type.tag() == IDLType.Tags.domstring
- value = "str::from_utf8(data).unwrap().to_owned()"
+ value = "str::from_utf8(data).unwrap().to_string()"
if type.nullable():
value = "Some(%s)" % value
@@ -691,7 +691,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
" Ok(None) => { %(handleInvalidEnumValueCode)s },\n"
" Ok(Some(index)) => {\n"
" //XXXjdm need some range checks up in here.\n"
- " unsafe { cast::transmute(index) }\n"
+ " unsafe { mem::transmute(index) }\n"
" },\n"
"}" % { "values" : enum + "Values::strings",
"exceptionCode" : exceptionCode,
@@ -2130,7 +2130,7 @@ class CGDefineDOMInterfaceMethod(CGAbstractMethod):
trace: Some(%s)
};
js_info.dom_static.proxy_handlers.insert(PrototypeList::id::%s as uint,
- CreateProxyHandler(&traps, cast::transmute(&Class)));
+ CreateProxyHandler(&traps, mem::transmute(&Class)));
""" % (FINALIZE_HOOK_NAME,
TRACE_HOOK_NAME,
@@ -2673,7 +2673,7 @@ pub static strings: &'static [&'static str] = &[
impl ToJSValConvertible for valuelist {
fn to_jsval(&self, cx: *mut JSContext) -> JSVal {
- strings[*self as uint].to_owned().to_jsval(cx)
+ strings[*self as uint].to_string().to_jsval(cx)
}
}
""" % (",\n ".join(map(getEnumValueName, enum.values())),
@@ -3821,7 +3821,7 @@ class CGAbstractClassHook(CGAbstractExternMethod):
def finalizeHook(descriptor, hookName, context):
release = """let val = JS_GetReservedSlot(obj, dom_object_slot(obj));
-let _: Box<%s> = cast::transmute(val.to_private());
+let _: Box<%s> = mem::transmute(val.to_private());
debug!("%s finalize: {:p}", this);
""" % (descriptor.concreteType, descriptor.concreteType)
return release
@@ -4343,7 +4343,7 @@ class CGBindingRoot(CGThing):
'script_task::JSPageInfo',
'libc',
'servo_util::str::DOMString',
- 'std::cast',
+ 'std::mem',
'std::cmp',
'std::ptr',
'std::str',
diff --git a/src/components/script/dom/bindings/codegen/GlobalGen.py b/src/components/script/dom/bindings/codegen/GlobalGen.py
index aa820d497b8..cdca464e029 100644
--- a/src/components/script/dom/bindings/codegen/GlobalGen.py
+++ b/src/components/script/dom/bindings/codegen/GlobalGen.py
@@ -17,9 +17,7 @@ from CodegenRust import GlobalGenRoots, replaceFileIfChanged
# import Codegen in general, so we can set a variable on it
import Codegen
-def generate_file(config, name):
- filename = name + '.rs'
-
+def generate_file(config, name, filename):
root = getattr(GlobalGenRoots, name)(config)
code = root.define()
@@ -65,21 +63,21 @@ def main():
config = Configuration(configFile, parserResults)
# Generate the prototype list.
- generate_file(config, 'PrototypeList')
+ generate_file(config, 'PrototypeList', 'PrototypeList.rs')
# Generate the common code.
- generate_file(config, 'RegisterBindings')
+ generate_file(config, 'RegisterBindings', 'RegisterBindings.rs')
# Generate the type list.
- generate_file(config, 'InterfaceTypes')
+ generate_file(config, 'InterfaceTypes', 'InterfaceTypes.rs')
# Generate the type list.
- generate_file(config, 'InheritTypes')
+ generate_file(config, 'InheritTypes', 'InheritTypes.rs')
# Generate the module declarations.
- generate_file(config, 'Bindings')
+ generate_file(config, 'Bindings', 'Bindings/mod.rs')
- generate_file(config, 'UnionTypes')
+ generate_file(config, 'UnionTypes', 'UnionTypes.rs')
if __name__ == '__main__':
main()