Bug 1427233 - BinParse checks whether the argument is an ArrayBuffer;r?jandem
MozReview-Commit-ID: 9ztVYwYtK0E
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -4409,24 +4409,24 @@ BinParse(JSContext* cx, unsigned argc, V
if (args.length() < 1) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_MORE_ARGS_NEEDED,
"parse", "0", "s");
return false;
}
if (!args[0].isObject()) {
const char* typeName = InformalValueTypeName(args[0]);
- JS_ReportErrorASCII(cx, "expected object (typed array) to parse, got %s", typeName);
+ JS_ReportErrorASCII(cx, "expected object (ArrayBuffer) to parse, got %s", typeName);
return false;
}
RootedObject obj(cx, &args[0].toObject());
- if (!JS_IsTypedArrayObject(obj)) {
+ if (!JS_IsArrayBufferObject(obj)) {
const char* typeName = InformalValueTypeName(args[0]);
- JS_ReportErrorASCII(cx, "expected typed array to parse, got %s", typeName);
+ JS_ReportErrorASCII(cx, "expected ArrayBuffer to parse, got %s", typeName);
return false;
}
uint32_t buf_length = 0;
bool buf_isSharedMemory = false;
uint8_t* buf_data = nullptr;
GetArrayBufferViewLengthAndData(obj, &buf_length, &buf_isSharedMemory, &buf_data);
MOZ_ASSERT(buf_data);