mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-04 22:37:29 +09:00
Align IDL record to C++ conversion with the spec when Symbol-named properties are involved
This commit is contained in:
parent
1729192b5d
commit
0b794697e3
1 changed files with 3 additions and 5 deletions
|
|
@ -4808,10 +4808,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
||||||
|
|
||||||
JS::Rooted<JSObject*> recordObj(cx, &$${val}.toObject());
|
JS::Rooted<JSObject*> recordObj(cx, &$${val}.toObject());
|
||||||
JS::AutoIdVector ids(cx);
|
JS::AutoIdVector ids(cx);
|
||||||
// Keep skipping symbols until
|
|
||||||
// https://github.com/heycam/webidl/issues/294 is sorted out.
|
|
||||||
if (!js::GetPropertyKeys(cx, recordObj,
|
if (!js::GetPropertyKeys(cx, recordObj,
|
||||||
JSITER_OWNONLY | JSITER_HIDDEN, &ids)) {
|
JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, &ids)) {
|
||||||
$*{exceptionCode}
|
$*{exceptionCode}
|
||||||
}
|
}
|
||||||
if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
|
if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
|
||||||
|
|
@ -4831,8 +4829,6 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
||||||
for (size_t i = 0; i < ids.length(); ++i) {
|
for (size_t i = 0; i < ids.length(); ++i) {
|
||||||
curId = ids[i];
|
curId = ids[i];
|
||||||
|
|
||||||
MOZ_ASSERT(!JSID_IS_SYMBOL(curId), "No symbols, we said!");
|
|
||||||
|
|
||||||
JS::Rooted<JS::PropertyDescriptor> desc(cx);
|
JS::Rooted<JS::PropertyDescriptor> desc(cx);
|
||||||
if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
|
if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
|
||||||
&desc)) {
|
&desc)) {
|
||||||
|
|
@ -4846,6 +4842,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
||||||
|
|
||||||
idVal = js::IdToValue(curId);
|
idVal = js::IdToValue(curId);
|
||||||
${keyType} propName;
|
${keyType} propName;
|
||||||
|
// This will just throw if idVal is a Symbol, like the spec says
|
||||||
|
// to do.
|
||||||
if (!${keyConversionFunction}(cx, idVal, propName)) {
|
if (!${keyConversionFunction}(cx, idVal, propName)) {
|
||||||
$*{exceptionCode}
|
$*{exceptionCode}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue