Skip to content

Commit

Permalink
Use JS_SplicePrototype to set the right proto on the global, instead …
Browse files Browse the repository at this point in the history
…of JS_SetPrototype, since the latter will permanently deoptimize it.
  • Loading branch information
bzbarsky committed Aug 24, 2016
1 parent 3993fde commit 5341f85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/script/dom/bindings/codegen/CodegenRust.py
Expand Up @@ -2394,7 +2394,7 @@ def definition_body(self):
let _ac = JSAutoCompartment::new(cx, obj.get());
rooted!(in(cx) let mut proto = ptr::null_mut());
GetProtoObject(cx, obj.handle(), proto.handle_mut());
JS_SetPrototype(cx, obj.handle(), proto.handle());
JS_SplicePrototype(cx, obj.handle(), proto.handle());
%(copyUnforgeable)s
Expand Down Expand Up @@ -5530,7 +5530,7 @@ def __init__(self, config, prefix, webIDLFile):
'js::jsapi::{JS_HasProperty, JS_HasPropertyById, JS_InitializePropertiesFromCompatibleNativeObject}',
'js::jsapi::{JS_AtomizeAndPinString, JS_NewObject, JS_NewObjectWithGivenProto}',
'js::jsapi::{JS_NewObjectWithoutMetadata, JS_SetProperty}',
'js::jsapi::{JS_SetPrototype, JS_SetReservedSlot, JSAutoCompartment}',
'js::jsapi::{JS_SplicePrototype, JS_SetReservedSlot, JSAutoCompartment}',
'js::jsapi::{JSContext, JSClass, JSFreeOp, JSFunctionSpec}',
'js::jsapi::{JSJitGetterCallArgs, JSJitInfo, JSJitMethodCallArgs, JSJitSetterCallArgs}',
'js::jsapi::{JSNative, JSObject, JSNativeWrapper, JSPropertySpec}',
Expand Down

0 comments on commit 5341f85

Please sign in to comment.