|
Line 0
Link Here
|
|
|
1 |
--- js/src/builtin/TypedObject.cpp.orig 2015-01-06 06:08:00.000000000 +0100 |
| 2 |
+++ js/src/builtin/TypedObject.cpp 2015-02-20 20:23:41.017121000 +0100 |
| 3 |
@@ -710,12 +710,12 @@ |
| 4 |
contents.append(")"); |
| 5 |
RootedAtom stringRepr(cx, contents.finishAtom()); |
| 6 |
if (!stringRepr) |
| 7 |
- return nullptr; |
| 8 |
+ return false; |
| 9 |
|
| 10 |
// Extract ArrayType.prototype |
| 11 |
RootedObject arrayTypePrototype(cx, GetPrototype(cx, arrayTypeGlobal)); |
| 12 |
if (!arrayTypePrototype) |
| 13 |
- return nullptr; |
| 14 |
+ return false; |
| 15 |
|
| 16 |
// Create the instance of ArrayType |
| 17 |
Rooted<UnsizedArrayTypeDescr *> obj(cx); |
| 18 |
@@ -728,7 +728,7 @@ |
| 19 |
if (!JSObject::defineProperty(cx, obj, cx->names().length, |
| 20 |
UndefinedHandleValue, nullptr, nullptr, |
| 21 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
| 22 |
- return nullptr; |
| 23 |
+ return false; |
| 24 |
|
| 25 |
args.rval().setObject(*obj); |
| 26 |
return true; |
| 27 |
@@ -762,7 +762,7 @@ |
| 28 |
if (!size.isValid()) { |
| 29 |
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, |
| 30 |
JSMSG_TYPEDOBJECT_TOO_BIG); |
| 31 |
- return nullptr; |
| 32 |
+ return false; |
| 33 |
} |
| 34 |
|
| 35 |
// Construct a canonical string `new ArrayType(<elementType>).dimension(N)`: |
| 36 |
@@ -775,7 +775,7 @@ |
| 37 |
contents.append(")"); |
| 38 |
RootedAtom stringRepr(cx, contents.finishAtom()); |
| 39 |
if (!stringRepr) |
| 40 |
- return nullptr; |
| 41 |
+ return false; |
| 42 |
|
| 43 |
// Create the sized type object. |
| 44 |
Rooted<SizedArrayTypeDescr*> obj(cx); |
| 45 |
@@ -793,7 +793,7 @@ |
| 46 |
if (!JSObject::defineProperty(cx, obj, cx->names().length, |
| 47 |
lengthVal, nullptr, nullptr, |
| 48 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
| 49 |
- return nullptr; |
| 50 |
+ return false; |
| 51 |
|
| 52 |
// Add `unsized` property, which is a link from the sized |
| 53 |
// array to the unsized array. |
| 54 |
@@ -801,7 +801,7 @@ |
| 55 |
if (!JSObject::defineProperty(cx, obj, cx->names().unsized, |
| 56 |
unsizedTypeDescrValue, nullptr, nullptr, |
| 57 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
| 58 |
- return nullptr; |
| 59 |
+ return false; |
| 60 |
|
| 61 |
args.rval().setObject(*obj); |
| 62 |
return true; |
| 63 |
@@ -1253,7 +1253,7 @@ |
| 64 |
Rooted<TypedProto*> proto(cx); |
| 65 |
proto = NewObjectWithProto<TypedProto>(cx, objProto, nullptr, TenuredObject); |
| 66 |
if (!proto) |
| 67 |
- return nullptr; |
| 68 |
+ return false; |
| 69 |
proto->initTypeDescrSlot(*descr); |
| 70 |
descr->initReservedSlot(JS_DESCR_SLOT_TYPROTO, ObjectValue(*proto)); |
| 71 |
|
| 72 |
@@ -1358,14 +1358,14 @@ |
| 73 |
#define BINARYDATA_SCALAR_DEFINE(constant_, type_, name_) \ |
| 74 |
if (!DefineSimpleTypeDescr<ScalarTypeDescr>(cx, global, module, constant_, \ |
| 75 |
cx->names().name_)) \ |
| 76 |
- return nullptr; |
| 77 |
+ return false; |
| 78 |
JS_FOR_EACH_SCALAR_TYPE_REPR(BINARYDATA_SCALAR_DEFINE) |
| 79 |
#undef BINARYDATA_SCALAR_DEFINE |
| 80 |
|
| 81 |
#define BINARYDATA_REFERENCE_DEFINE(constant_, type_, name_) \ |
| 82 |
if (!DefineSimpleTypeDescr<ReferenceTypeDescr>(cx, global, module, constant_, \ |
| 83 |
cx->names().name_)) \ |
| 84 |
- return nullptr; |
| 85 |
+ return false; |
| 86 |
JS_FOR_EACH_REFERENCE_TYPE_REPR(BINARYDATA_REFERENCE_DEFINE) |
| 87 |
#undef BINARYDATA_REFERENCE_DEFINE |
| 88 |
|
| 89 |
@@ -1375,14 +1375,14 @@ |
| 90 |
arrayType = DefineMetaTypeDescr<ArrayMetaTypeDescr>( |
| 91 |
cx, global, module, TypedObjectModuleObject::ArrayTypePrototype); |
| 92 |
if (!arrayType) |
| 93 |
- return nullptr; |
| 94 |
+ return false; |
| 95 |
|
| 96 |
RootedValue arrayTypeValue(cx, ObjectValue(*arrayType)); |
| 97 |
if (!JSObject::defineProperty(cx, module, cx->names().ArrayType, |
| 98 |
arrayTypeValue, |
| 99 |
nullptr, nullptr, |
| 100 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
| 101 |
- return nullptr; |
| 102 |
+ return false; |
| 103 |
|
| 104 |
// StructType. |
| 105 |
|
| 106 |
@@ -1390,14 +1390,14 @@ |
| 107 |
structType = DefineMetaTypeDescr<StructMetaTypeDescr>( |
| 108 |
cx, global, module, TypedObjectModuleObject::StructTypePrototype); |
| 109 |
if (!structType) |
| 110 |
- return nullptr; |
| 111 |
+ return false; |
| 112 |
|
| 113 |
RootedValue structTypeValue(cx, ObjectValue(*structType)); |
| 114 |
if (!JSObject::defineProperty(cx, module, cx->names().StructType, |
| 115 |
structTypeValue, |
| 116 |
nullptr, nullptr, |
| 117 |
JSPROP_READONLY | JSPROP_PERMANENT)) |
| 118 |
- return nullptr; |
| 119 |
+ return false; |
| 120 |
|
| 121 |
// Everything is setup, install module on the global object: |
| 122 |
RootedValue moduleValue(cx, ObjectValue(*module)); |
| 123 |
@@ -1407,7 +1407,7 @@ |
| 124 |
nullptr, nullptr, |
| 125 |
0)) |
| 126 |
{ |
| 127 |
- return nullptr; |
| 128 |
+ return false; |
| 129 |
} |
| 130 |
|
| 131 |
return module; |
| 132 |
@@ -2466,7 +2466,7 @@ |
| 133 |
if (length < 0) { |
| 134 |
JS_ReportErrorNumber(cx, js_GetErrorMessage, |
| 135 |
nullptr, JSMSG_TYPEDOBJECT_BAD_ARGS); |
| 136 |
- return nullptr; |
| 137 |
+ return false; |
| 138 |
} |
| 139 |
Rooted<TypedObject*> obj(cx, createZeroed(cx, callee, length)); |
| 140 |
if (!obj) |