Bug 1777413: Permit zero-length external ArrayBuffers. r=tcampbell

Depends on D150624

Differential Revision: https://phabricator.services.mozilla.com/D150701
This commit is contained in:
Jim Blandy
2022-06-30 18:27:41 +00:00
parent f891b9ae96
commit 31cfe7667a
3 changed files with 8 additions and 3 deletions

View File

@@ -1711,8 +1711,8 @@ static bool CreateExternalArrayBuffer(JSContext* cx, unsigned argc, Value* vp) {
return false;
}
if (bytes <= 0) {
JS_ReportErrorASCII(cx, "Size must be positive");
if (bytes < 0) {
JS_ReportErrorASCII(cx, "Size must be non-negative");
return false;
}