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

Differential Revision: https://phabricator.services.mozilla.com/D150701
also remove redundant assertion that a size_t >= 0.
This commit is contained in:
Jim Blandy
2022-06-30 18:55:29 +00:00
parent 630c388273
commit 22eb5b2c8b
3 changed files with 7 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;
}