Line
Link Here
|
0 |
-- a/comm-esr31/mozilla/js/src/builtin/TypedObject.cpp |
0 |
++ b/comm-esr31/mozilla/js/src/builtin/TypedObject.cpp |
Lines 710-721
Link Here
|
710 |
contents.append(")"); |
710 |
contents.append(")"); |
711 |
RootedAtom stringRepr(cx, contents.finishAtom()); |
711 |
RootedAtom stringRepr(cx, contents.finishAtom()); |
712 |
if (!stringRepr) |
712 |
if (!stringRepr) |
713 |
return nullptr; |
713 |
return false; |
714 |
|
714 |
|
715 |
// Extract ArrayType.prototype |
715 |
// Extract ArrayType.prototype |
716 |
RootedObject arrayTypePrototype(cx, GetPrototype(cx, arrayTypeGlobal)); |
716 |
RootedObject arrayTypePrototype(cx, GetPrototype(cx, arrayTypeGlobal)); |
717 |
if (!arrayTypePrototype) |
717 |
if (!arrayTypePrototype) |
718 |
return nullptr; |
718 |
return false; |
719 |
|
719 |
|
720 |
// Create the instance of ArrayType |
720 |
// Create the instance of ArrayType |
721 |
Rooted<UnsizedArrayTypeDescr*> obj(cx); |
721 |
Rooted<UnsizedArrayTypeDescr*> obj(cx); |
Lines 728-734
Link Here
|
728 |
if (!JSObject::defineProperty(cx, obj, cx->names().length, |
728 |
if (!JSObject::defineProperty(cx, obj, cx->names().length, |
729 |
UndefinedHandleValue, nullptr, nullptr, |
729 |
UndefinedHandleValue, nullptr, nullptr, |
730 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
730 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
731 |
return nullptr; |
731 |
return false; |
732 |
|
732 |
|
733 |
args.rval().setObject(*obj); |
733 |
args.rval().setObject(*obj); |
734 |
return true; |
734 |
return true; |
Lines 762-768
Link Here
|
762 |
if (!size.isValid()) { |
762 |
if (!size.isValid()) { |
763 |
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, |
763 |
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, |
764 |
JSMSG_TYPEDOBJECT_TOO_BIG); |
764 |
JSMSG_TYPEDOBJECT_TOO_BIG); |
765 |
return nullptr; |
765 |
return false; |
766 |
} |
766 |
} |
767 |
|
767 |
|
768 |
// Construct a canonical string `new ArrayType(<elementType>).dimension(N)`: |
768 |
// Construct a canonical string `new ArrayType(<elementType>).dimension(N)`: |
Lines 775-781
Link Here
|
775 |
contents.append(")"); |
775 |
contents.append(")"); |
776 |
RootedAtom stringRepr(cx, contents.finishAtom()); |
776 |
RootedAtom stringRepr(cx, contents.finishAtom()); |
777 |
if (!stringRepr) |
777 |
if (!stringRepr) |
778 |
return nullptr; |
778 |
return false; |
779 |
|
779 |
|
780 |
// Create the sized type object. |
780 |
// Create the sized type object. |
781 |
Rooted<SizedArrayTypeDescr*> obj(cx); |
781 |
Rooted<SizedArrayTypeDescr*> obj(cx); |
Lines 793-799
Link Here
|
793 |
if (!JSObject::defineProperty(cx, obj, cx->names().length, |
793 |
if (!JSObject::defineProperty(cx, obj, cx->names().length, |
794 |
lengthVal, nullptr, nullptr, |
794 |
lengthVal, nullptr, nullptr, |
795 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
795 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
796 |
return nullptr; |
796 |
return false; |
797 |
|
797 |
|
798 |
// Add `unsized` property, which is a link from the sized |
798 |
// Add `unsized` property, which is a link from the sized |
799 |
// array to the unsized array. |
799 |
// array to the unsized array. |
Lines 801-807
Link Here
|
801 |
if (!JSObject::defineProperty(cx, obj, cx->names().unsized, |
801 |
if (!JSObject::defineProperty(cx, obj, cx->names().unsized, |
802 |
unsizedTypeDescrValue, nullptr, nullptr, |
802 |
unsizedTypeDescrValue, nullptr, nullptr, |
803 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
803 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
804 |
return nullptr; |
804 |
return false; |
805 |
|
805 |
|
806 |
args.rval().setObject(*obj); |
806 |
args.rval().setObject(*obj); |
807 |
return true; |
807 |
return true; |
Lines 1253-1259
Link Here
|
1253 |
Rooted<TypedProto*> proto(cx); |
1253 |
Rooted<TypedProto*> proto(cx); |
1254 |
proto = NewObjectWithProto<TypedProto>(cx, objProto, nullptr, TenuredObject); |
1254 |
proto = NewObjectWithProto<TypedProto>(cx, objProto, nullptr, TenuredObject); |
1255 |
if (!proto) |
1255 |
if (!proto) |
1256 |
return nullptr; |
1256 |
return false; |
1257 |
proto->initTypeDescrSlot(*descr); |
1257 |
proto->initTypeDescrSlot(*descr); |
1258 |
descr->initReservedSlot(JS_DESCR_SLOT_TYPROTO, ObjectValue(*proto)); |
1258 |
descr->initReservedSlot(JS_DESCR_SLOT_TYPROTO, ObjectValue(*proto)); |
1259 |
|
1259 |
|
Lines 1358-1371
Link Here
|
1358 |
#define BINARYDATA_SCALAR_DEFINE(constant_, type_, name_) \ |
1358 |
#define BINARYDATA_SCALAR_DEFINE(constant_, type_, name_) \ |
1359 |
if (!DefineSimpleTypeDescr<ScalarTypeDescr>(cx, global, module, constant_, \ |
1359 |
if (!DefineSimpleTypeDescr<ScalarTypeDescr>(cx, global, module, constant_, \ |
1360 |
cx->names().name_)) \ |
1360 |
cx->names().name_)) \ |
1361 |
return nullptr; |
1361 |
return false; |
1362 |
JS_FOR_EACH_SCALAR_TYPE_REPR(BINARYDATA_SCALAR_DEFINE) |
1362 |
JS_FOR_EACH_SCALAR_TYPE_REPR(BINARYDATA_SCALAR_DEFINE) |
1363 |
#undef BINARYDATA_SCALAR_DEFINE |
1363 |
#undef BINARYDATA_SCALAR_DEFINE |
1364 |
|
1364 |
|
1365 |
#define BINARYDATA_REFERENCE_DEFINE(constant_, type_, name_) \ |
1365 |
#define BINARYDATA_REFERENCE_DEFINE(constant_, type_, name_) \ |
1366 |
if (!DefineSimpleTypeDescr<ReferenceTypeDescr>(cx, global, module, constant_, \ |
1366 |
if (!DefineSimpleTypeDescr<ReferenceTypeDescr>(cx, global, module, constant_, \ |
1367 |
cx->names().name_)) \ |
1367 |
cx->names().name_)) \ |
1368 |
return nullptr; |
1368 |
return false; |
1369 |
JS_FOR_EACH_REFERENCE_TYPE_REPR(BINARYDATA_REFERENCE_DEFINE) |
1369 |
JS_FOR_EACH_REFERENCE_TYPE_REPR(BINARYDATA_REFERENCE_DEFINE) |
1370 |
#undef BINARYDATA_REFERENCE_DEFINE |
1370 |
#undef BINARYDATA_REFERENCE_DEFINE |
1371 |
|
1371 |
|
Lines 1375-1388
Link Here
|
1375 |
arrayType = DefineMetaTypeDescr<ArrayMetaTypeDescr>( |
1375 |
arrayType = DefineMetaTypeDescr<ArrayMetaTypeDescr>( |
1376 |
cx, global, module, TypedObjectModuleObject::ArrayTypePrototype); |
1376 |
cx, global, module, TypedObjectModuleObject::ArrayTypePrototype); |
1377 |
if (!arrayType) |
1377 |
if (!arrayType) |
1378 |
return nullptr; |
1378 |
return false; |
1379 |
|
1379 |
|
1380 |
RootedValue arrayTypeValue(cx, ObjectValue(*arrayType)); |
1380 |
RootedValue arrayTypeValue(cx, ObjectValue(*arrayType)); |
1381 |
if (!JSObject::defineProperty(cx, module, cx->names().ArrayType, |
1381 |
if (!JSObject::defineProperty(cx, module, cx->names().ArrayType, |
1382 |
arrayTypeValue, |
1382 |
arrayTypeValue, |
1383 |
nullptr, nullptr, |
1383 |
nullptr, nullptr, |
1384 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
1384 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
1385 |
return nullptr; |
1385 |
return false; |
1386 |
|
1386 |
|
1387 |
// StructType. |
1387 |
// StructType. |
1388 |
|
1388 |
|
Lines 1390-1403
Link Here
|
1390 |
structType = DefineMetaTypeDescr<StructMetaTypeDescr>( |
1390 |
structType = DefineMetaTypeDescr<StructMetaTypeDescr>( |
1391 |
cx, global, module, TypedObjectModuleObject::StructTypePrototype); |
1391 |
cx, global, module, TypedObjectModuleObject::StructTypePrototype); |
1392 |
if (!structType) |
1392 |
if (!structType) |
1393 |
return nullptr; |
1393 |
return false; |
1394 |
|
1394 |
|
1395 |
RootedValue structTypeValue(cx, ObjectValue(*structType)); |
1395 |
RootedValue structTypeValue(cx, ObjectValue(*structType)); |
1396 |
if (!JSObject::defineProperty(cx, module, cx->names().StructType, |
1396 |
if (!JSObject::defineProperty(cx, module, cx->names().StructType, |
1397 |
structTypeValue, |
1397 |
structTypeValue, |
1398 |
nullptr, nullptr, |
1398 |
nullptr, nullptr, |
1399 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
1399 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
1400 |
return nullptr; |
1400 |
return false; |
1401 |
|
1401 |
|
1402 |
// Everything is setup, install module on the global object: |
1402 |
// Everything is setup, install module on the global object: |
1403 |
RootedValue moduleValue(cx, ObjectValue(*module)); |
1403 |
RootedValue moduleValue(cx, ObjectValue(*module)); |
Lines 1407-1413
Link Here
|
1407 |
nullptr, nullptr, |
1407 |
nullptr, nullptr, |
1408 |
0)) |
1408 |
0)) |
1409 |
{ |
1409 |
{ |
1410 |
return nullptr; |
1410 |
return false; |
1411 |
} |
1411 |
} |
1412 |
|
1412 |
|
1413 |
return module; |
1413 |
return module; |
Lines 2466-2472
Link Here
|
2466 |
if (length < 0) { |
2466 |
if (length < 0) { |
2467 |
JS_ReportErrorNumber(cx, js_GetErrorMessage, |
2467 |
JS_ReportErrorNumber(cx, js_GetErrorMessage, |
2468 |
nullptr, JSMSG_TYPEDOBJECT_BAD_ARGS); |
2468 |
nullptr, JSMSG_TYPEDOBJECT_BAD_ARGS); |
2469 |
return nullptr; |
2469 |
return false; |
2470 |
} |
2470 |
} |
2471 |
Rooted<TypedObject*> obj(cx, createZeroed(cx, callee, length)); |
2471 |
Rooted<TypedObject*> obj(cx, createZeroed(cx, callee, length)); |
2472 |
if (!obj) |
2472 |
if (!obj) |
2473 |
-- a/comm-esr31/mozilla/js/src/frontend/BytecodeCompiler.cpp |
2473 |
++ b/comm-esr31/mozilla/js/src/frontend/BytecodeCompiler.cpp |
Lines 544-550
Link Here
|
544 |
|
544 |
|
545 |
RootedScriptSource sourceObject(cx, CreateScriptSourceObject(cx, options)); |
545 |
RootedScriptSource sourceObject(cx, CreateScriptSourceObject(cx, options)); |
546 |
if (!sourceObject) |
546 |
if (!sourceObject) |
547 |
return nullptr; |
547 |
return false; |
548 |
ScriptSource* ss = sourceObject->source(); |
548 |
ScriptSource* ss = sourceObject->source(); |
549 |
|
549 |
|
550 |
SourceCompressionTask sct(cx); |
550 |
SourceCompressionTask sct(cx); |
551 |
-- a/comm-esr31/mozilla/netwerk/ipc/NeckoParent.cpp |
551 |
++ b/comm-esr31/mozilla/netwerk/ipc/NeckoParent.cpp |
Lines 359-365
Link Here
|
359 |
RtspChannelParent* p = static_cast<RtspChannelParent*>(aActor); |
359 |
RtspChannelParent* p = static_cast<RtspChannelParent*>(aActor); |
360 |
return p->Init(aConnectArgs); |
360 |
return p->Init(aConnectArgs); |
361 |
#else |
361 |
#else |
362 |
return nullptr; |
362 |
return false; |
363 |
#endif |
363 |
#endif |
364 |
} |
364 |
} |
365 |
|
365 |
|
366 |
-- a/comm-esr31/mozilla/js/xpconnect/wrappers/XrayWrapper.cpp |
366 |
++ b/comm-esr31/mozilla/js/xpconnect/wrappers/XrayWrapper.cpp |
Lines 351-357
Link Here
|
351 |
{ |
351 |
{ |
352 |
JSAutoCompartment ac(cx, target); |
352 |
JSAutoCompartment ac(cx, target); |
353 |
if (!JS_GetClassPrototype(cx, key, protop)) |
353 |
if (!JS_GetClassPrototype(cx, key, protop)) |
354 |
return nullptr; |
354 |
return false; |
355 |
} |
355 |
} |
356 |
return JS_WrapObject(cx, protop); |
356 |
return JS_WrapObject(cx, protop); |
357 |
} |
357 |
} |