mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Fix JS_ObjectIsDate() call in webidl codegen.
We were missing the import, and the prototype of the function has since changed. Partial fix for #10675
This commit is contained in:
parent
d90499ab35
commit
af380c2717
1 changed files with 6 additions and 1 deletions
|
@ -467,7 +467,11 @@ class CGMethodCall(CGThing):
|
||||||
|
|
||||||
# Check for Date objects
|
# Check for Date objects
|
||||||
# XXXbz Do we need to worry about security wrappers around the Date?
|
# XXXbz Do we need to worry about security wrappers around the Date?
|
||||||
pickFirstSignature("%s.get().is_object() && JS_ObjectIsDate(cx, &%s.get().to_object())" %
|
pickFirstSignature("%s.get().is_object() && "
|
||||||
|
"{ rooted!(in(cx) let obj = %s.get().to_object()); "
|
||||||
|
"let mut is_date = false; "
|
||||||
|
"assert!(JS_ObjectIsDate(cx, obj.handle(), &mut is_date)); "
|
||||||
|
"is_date }" %
|
||||||
(distinguishingArg, distinguishingArg),
|
(distinguishingArg, distinguishingArg),
|
||||||
lambda s: (s[1][distinguishingIndex].type.isDate() or
|
lambda s: (s[1][distinguishingIndex].type.isDate() or
|
||||||
s[1][distinguishingIndex].type.isObject()))
|
s[1][distinguishingIndex].type.isObject()))
|
||||||
|
@ -5468,6 +5472,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
|
||||||
'js::jsapi::JS_NewObject',
|
'js::jsapi::JS_NewObject',
|
||||||
'js::jsapi::JS_NewObjectWithGivenProto',
|
'js::jsapi::JS_NewObjectWithGivenProto',
|
||||||
'js::jsapi::JS_NewObjectWithoutMetadata',
|
'js::jsapi::JS_NewObjectWithoutMetadata',
|
||||||
|
'js::jsapi::JS_ObjectIsDate',
|
||||||
'js::jsapi::JS_SetImmutablePrototype',
|
'js::jsapi::JS_SetImmutablePrototype',
|
||||||
'js::jsapi::JS_SetProperty',
|
'js::jsapi::JS_SetProperty',
|
||||||
'js::jsapi::JS_SetReservedSlot',
|
'js::jsapi::JS_SetReservedSlot',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue