Bug 1427233 - BinParse checks whether the argument is an ArrayBuffer;r=jandem

MozReview-Commit-ID: 9ztVYwYtK0E

--HG--
extra : rebase_source : 5e9ea3a38fe8ceba240a9b8d5973930923b0061b
This commit is contained in:
David Teller 2018-01-17 12:14:06 +01:00
Родитель 6062c401f8
Коммит b052df8f9b
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -4508,14 +4508,14 @@ BinParse(JSContext* cx, unsigned argc, Value* vp)
}
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;
}