Bug 1398839 - DataView getters should throw when the buffer is detached in release/beta. r=anba

--HG--
extra : rebase_source : 188d9d525d34cf821cbd417bd25942c93f907b2b
This commit is contained in:
Tom Schuster 2018-06-23 23:20:47 +02:00
Родитель 2ac3c0911d
Коммит ff8c84fe6a
2 изменённых файлов: 2 добавлений и 10 удалений

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

@ -853,13 +853,11 @@ DataViewObject::byteLengthGetterImpl(JSContext* cx, const CallArgs& args)
{
Rooted<DataViewObject*> thisView(cx, &args.thisv().toObject().as<DataViewObject>());
#ifdef NIGHTLY_BUILD
// Step 6,
// 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));
@ -878,13 +876,11 @@ DataViewObject::byteOffsetGetterImpl(JSContext* cx, const CallArgs& args)
{
Rooted<DataViewObject*> thisView(cx, &args.thisv().toObject().as<DataViewObject>());
#ifdef NIGHTLY_BUILD
// Step 6,
// 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));

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

@ -280,10 +280,6 @@ skip script test262/built-ins/WeakSet/proto-from-ctor-realm.js
# https://bugzilla.mozilla.org/show_bug.cgi?id=1317395
skip script test262/built-ins/ArrayBuffer/prototype/byteLength/detached-buffer.js
# https://bugzilla.mozilla.org/show_bug.cgi?id=1317394
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
# https://bugzilla.mozilla.org/show_bug.cgi?id=1317378
skip script test262/language/statements/do-while/cptn-abrupt-empty.js
skip script test262/language/statements/do-while/cptn-normal.js