diff options
author | Josh Matthews <josh@joshmatthews.net> | 2019-07-25 12:12:33 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2019-07-25 20:23:21 -0400 |
commit | 410d5bc772e0ad851692efe2a2131833312d3dd0 (patch) | |
tree | 6a839b5d33bd96726b101784f4732df1e6871e39 /components/script/dom/bindings/codegen/CodegenRust.py | |
parent | c9dde3a4bb9a6e4c8d69888a21c7117129f8f95e (diff) | |
download | servo-410d5bc772e0ad851692efe2a2131833312d3dd0.tar.gz servo-410d5bc772e0ad851692efe2a2131833312d3dd0.zip |
Update SpiderMonkey bindings for Windows arm64 crash fix.
Diffstat (limited to 'components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r-- | components/script/dom/bindings/codegen/CodegenRust.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 343b8e6596d..c7b2c1fe5ef 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -3036,8 +3036,9 @@ assert!((*cache)[PrototypeList::Constructor::%(id)s as usize].is_null()); if aliasedMembers: def defineAlias(alias): if alias == "@@iterator": - symbolJSID = "RUST_SYMBOL_TO_JSID(GetWellKnownSymbol(*cx, SymbolCode::iterator))" - getSymbolJSID = CGGeneric(fill("rooted!(in(*cx) let iteratorId = ${symbolJSID});", + symbolJSID = "RUST_SYMBOL_TO_JSID(GetWellKnownSymbol(*cx, SymbolCode::iterator), \ + iteratorId.handle_mut())" + getSymbolJSID = CGGeneric(fill("rooted!(in(*cx) let mut iteratorId: jsid);\n${symbolJSID};\n", symbolJSID=symbolJSID)) defineFn = "JS_DefinePropertyById2" prop = "iteratorId.handle()" @@ -5197,8 +5198,9 @@ class CGDOMJSProxyHandler_ownPropertyKeys(CGAbstractExternMethod): body += dedent( """ for i in 0..(*unwrapped_proxy).Length() { - rooted!(in(*cx) let rooted_jsid = int_to_jsid(i as i32)); - AppendToAutoIdVector(props, rooted_jsid.handle().get()); + rooted!(in(*cx) let mut rooted_jsid: jsid); + int_to_jsid(i as i32, rooted_jsid.handle_mut()); + AppendToAutoIdVector(props, rooted_jsid.handle()); } """) @@ -5209,9 +5211,9 @@ class CGDOMJSProxyHandler_ownPropertyKeys(CGAbstractExternMethod): let cstring = CString::new(name).unwrap(); let jsstring = JS_AtomizeAndPinString(*cx, cstring.as_ptr()); rooted!(in(*cx) let rooted = jsstring); - let jsid = INTERNED_STRING_TO_JSID(*cx, rooted.handle().get()); - rooted!(in(*cx) let rooted_jsid = jsid); - AppendToAutoIdVector(props, rooted_jsid.handle().get()); + rooted!(in(*cx) let mut rooted_jsid: jsid); + RUST_INTERNED_STRING_TO_JSID(*cx, rooted.handle().get(), rooted_jsid.handle_mut()); + AppendToAutoIdVector(props, rooted_jsid.handle()); } """) @@ -5254,8 +5256,9 @@ class CGDOMJSProxyHandler_getOwnEnumerablePropertyKeys(CGAbstractExternMethod): body += dedent( """ for i in 0..(*unwrapped_proxy).Length() { - rooted!(in(*cx) let rooted_jsid = int_to_jsid(i as i32)); - AppendToAutoIdVector(props, rooted_jsid.handle().get()); + rooted!(in(*cx) let mut rooted_jsid: jsid); + int_to_jsid(i as i32, rooted_jsid.handle_mut()); + AppendToAutoIdVector(props, rooted_jsid.handle()); } """) @@ -5800,7 +5803,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries 'js::jsapi::HandleValue as RawHandleValue', 'js::jsapi::HandleValueArray', 'js::jsapi::Heap', - 'js::jsapi::INTERNED_STRING_TO_JSID', + 'js::rust::wrappers::RUST_INTERNED_STRING_TO_JSID', 'js::jsapi::IsCallable', 'js::jsapi::JSAutoRealm', 'js::jsapi::JSCLASS_FOREGROUND_FINALIZE', @@ -5884,7 +5887,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries 'js::jsval::PrivateValue', 'js::jsval::UndefinedValue', 'js::jsapi::UndefinedHandleValue', - 'js::glue::AppendToAutoIdVector', + 'js::rust::wrappers::AppendToAutoIdVector', 'js::glue::CallJitGetterOp', 'js::glue::CallJitMethodOp', 'js::glue::CallJitSetterOp', @@ -5895,8 +5898,8 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries 'js::glue::ProxyTraps', 'js::glue::RUST_JSID_IS_INT', 'js::glue::RUST_JSID_IS_STRING', - 'js::glue::RUST_SYMBOL_TO_JSID', - 'js::glue::int_to_jsid', + 'js::rust::wrappers::RUST_SYMBOL_TO_JSID', + 'js::rust::wrappers::int_to_jsid', 'js::glue::UnwrapObjectDynamic', 'js::panic::maybe_resume_unwind', 'js::panic::wrap_panic', |