зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
6062c401f8
Коммит
b052df8f9b
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче