mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
Bug 1317394 - Make DataView getters throw for detached array buffers in Nightly. r=anba
This commit is contained in:
parent
a322b42abf
commit
8468764895
@ -887,6 +887,16 @@ bool
|
||||
DataViewObject::byteLengthGetterImpl(JSContext* cx, const CallArgs& args)
|
||||
{
|
||||
Rooted<DataViewObject*> thisView(cx, &args.thisv().toObject().as<DataViewObject>());
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
// Step 6,
|
||||
if (thisView->arrayBufferEither().isDetached()) {
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_TYPED_ARRAY_DETACHED);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Step 7.
|
||||
args.rval().set(DataViewObject::byteLengthValue(thisView));
|
||||
return true;
|
||||
}
|
||||
@ -902,6 +912,16 @@ bool
|
||||
DataViewObject::byteOffsetGetterImpl(JSContext* cx, const CallArgs& args)
|
||||
{
|
||||
Rooted<DataViewObject*> thisView(cx, &args.thisv().toObject().as<DataViewObject>());
|
||||
|
||||
#ifdef NIGHTLY_BUILD
|
||||
// Step 6,
|
||||
if (thisView->arrayBufferEither().isDetached()) {
|
||||
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_TYPED_ARRAY_DETACHED);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Step 7.
|
||||
args.rval().set(DataViewObject::byteOffsetValue(thisView));
|
||||
return true;
|
||||
}
|
||||
|
@ -296,8 +296,8 @@ skip script test262/built-ins/WeakSet/proto-from-ctor-realm.js
|
||||
skip script test262/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js
|
||||
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1317394
|
||||
skip script test262/built-ins/DataView/prototype/byteOffset/detached-buffer.js
|
||||
skip script test262/built-ins/DataView/prototype/byteLength/detached-buffer.js
|
||||
skip-if(release_or_beta) script test262/built-ins/DataView/prototype/byteOffset/detached-buffer.js
|
||||
skip-if(release_or_beta) script test262/built-ins/DataView/prototype/byteLength/detached-buffer.js
|
||||
|
||||
# We're still waiting for a final decision on https://github.com/tc39/ecma402/pull/84.
|
||||
skip script test262/intl402/Collator/10.1.1_1.js
|
||||
|
Loading…
Reference in New Issue
Block a user