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

Differential Revision: https://phabricator.services.mozilla.com/D150701
This commit is contained in:
Jim Blandy
2022-07-05 20:20:39 +00:00
parent 769dc2dbf0
commit 018ca4cf35
3 changed files with 9 additions and 3 deletions

View File

@@ -1712,8 +1712,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;
}