mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Fix detach check in ArrayBuffer.prototype.resize (#681)
This commit is contained in:
parent
fa4d2454aa
commit
1cc19e4dbf
2 changed files with 2 additions and 4 deletions
|
@ -51982,6 +51982,8 @@ static JSValue js_array_buffer_resize(JSContext *ctx, JSValue this_val,
|
||||||
abuf = JS_GetOpaque2(ctx, this_val, class_id);
|
abuf = JS_GetOpaque2(ctx, this_val, class_id);
|
||||||
if (!abuf)
|
if (!abuf)
|
||||||
return JS_EXCEPTION;
|
return JS_EXCEPTION;
|
||||||
|
if (JS_ToInt64(ctx, &len, argv[0]))
|
||||||
|
return JS_EXCEPTION;
|
||||||
if (abuf->detached)
|
if (abuf->detached)
|
||||||
return JS_ThrowTypeErrorDetachedArrayBuffer(ctx);
|
return JS_ThrowTypeErrorDetachedArrayBuffer(ctx);
|
||||||
if (!array_buffer_is_resizable(abuf))
|
if (!array_buffer_is_resizable(abuf))
|
||||||
|
@ -51989,8 +51991,6 @@ static JSValue js_array_buffer_resize(JSContext *ctx, JSValue this_val,
|
||||||
// TODO(bnoordhuis) support externally managed RABs
|
// TODO(bnoordhuis) support externally managed RABs
|
||||||
if (abuf->free_func != js_array_buffer_free)
|
if (abuf->free_func != js_array_buffer_free)
|
||||||
return JS_ThrowTypeError(ctx, "external array buffer is not resizable");
|
return JS_ThrowTypeError(ctx, "external array buffer is not resizable");
|
||||||
if (JS_ToInt64(ctx, &len, argv[0]))
|
|
||||||
return JS_EXCEPTION;
|
|
||||||
if (len < 0 || len > abuf->max_byte_length) {
|
if (len < 0 || len > abuf->max_byte_length) {
|
||||||
bad_length:
|
bad_length:
|
||||||
return JS_ThrowRangeError(ctx, "invalid array buffer length");
|
return JS_ThrowRangeError(ctx, "invalid array buffer length");
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
test262/test/built-ins/ArrayBuffer/prototype/resize/coerced-new-length-detach.js:15: Test262Error: Expected a TypeError to be thrown but no exception was thrown at all
|
|
||||||
test262/test/built-ins/ArrayBuffer/prototype/resize/coerced-new-length-detach.js:15: strict mode: Test262Error: Expected a TypeError to be thrown but no exception was thrown at all
|
|
||||||
test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-poisoned-wrapper.js:64: TypeError: $DONE() not called
|
test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-poisoned-wrapper.js:64: TypeError: $DONE() not called
|
||||||
test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-poisoned-wrapper.js:64: strict mode: TypeError: $DONE() not called
|
test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-poisoned-wrapper.js:64: strict mode: TypeError: $DONE() not called
|
||||||
test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/next-result-poisoned-wrapper.js:69: TypeError: $DONE() not called
|
test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/next-result-poisoned-wrapper.js:69: TypeError: $DONE() not called
|
||||||
|
|
Loading…
Reference in a new issue