mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 968866 -- Freeze user-visible offset/type vectors r=till
This commit is contained in:
parent
f8b4143e01
commit
8961875e86
@ -911,6 +911,12 @@ StructMetaTypeDescr::layout(JSContext *cx,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!JSObject::freeze(cx, fieldOffsets))
|
||||
return false;
|
||||
|
||||
if (!JSObject::freeze(cx, fieldTypes))
|
||||
return false;
|
||||
|
||||
RootedValue fieldOffsetsValue(cx, ObjectValue(*fieldOffsets));
|
||||
if (!JSObject::defineProperty(cx, structType, cx->names().fieldOffsets,
|
||||
fieldOffsetsValue, nullptr, nullptr,
|
||||
|
@ -36,6 +36,10 @@ function runTests() {
|
||||
assertEq(S.fieldOffsets.y, 4);
|
||||
assertEq(S.fieldOffsets.z, 8);
|
||||
|
||||
// fieldTypes and fieldOffsets should be frozen
|
||||
assertEq(Object.isFrozen(S.fieldTypes), true);
|
||||
assertEq(Object.isFrozen(S.fieldOffsets), true);
|
||||
|
||||
if (typeof reportCompare === "function")
|
||||
reportCompare(true, true);
|
||||
print("Tests complete");
|
||||
|
Loading…
Reference in New Issue
Block a user