Fix more v8 errors (#336)

- change error message for `Object.create` invalid property descriptor
- disable v8 test cases for deprecated legacy RegExp static properties
  and invalid left hand side error type
- update v8.txt
- fix v8.sh behavior for single tests
This commit is contained in:
Charlie Gordon 2024-03-30 13:11:37 +01:00 committed by GitHub
parent f80a5b08cf
commit 8b56215cc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 19 additions and 274 deletions

View file

@ -34950,7 +34950,7 @@ static int js_obj_to_desc(JSContext *ctx, JSPropertyDescriptor *d,
}
if ((flags & (JS_PROP_HAS_SET | JS_PROP_HAS_GET)) &&
(flags & (JS_PROP_HAS_VALUE | JS_PROP_HAS_WRITABLE))) {
JS_ThrowTypeError(ctx, "cannot have setter/getter and value or writable");
JS_ThrowTypeError(ctx, "Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");
goto fail;
}
d->flags = flags;

11
v8.js
View file

@ -15,11 +15,22 @@ const exclude = [
"disallow-codegen-from-strings.js", // --disallow-code-generation-from-strings
"cyclic-array-to-string.js", // unstable output due to stack overflow
"error-tostring.js", // unstable output due to stack overflow
"invalid-lhs.js", // v8 expects ReferenceError but ECMA says SyntaxError
"regexp.js", // invalid, legitimate early SyntaxError
"regexp-capture-3.js", // slow
"regexp-cache-replace.js", // deprecated RegExp.$1 etc.
"regexp-indexof.js", // deprecated RegExp.lastMatch etc.
"regexp-static.js", // deprecated RegExp static properties.
"regexp-modifiers-autogenerated-i18n.js", // invalid group
"regexp-modifiers-autogenerated.js", // invalid group
"regexp-modifiers-dotall.js", // invalid group
"regexp-modifiers-i18n.js", // invalid group
"regexp-modifiers.js", // invalid group
"regexp-override-symbol-match-all.js", // missing g flag
"serialize-embedded-error.js", // parseInt() = 0;
"string-replace.js", // unstable output
"string-match.js", // deprecated RegExp.$1 etc.
"string-slices-regexp.js", // deprecated RegExp.$1 etc.
"omit-default-ctors-array-iterator.js",
"mjsunit.js",

10
v8.sh
View file

@ -1,6 +1,10 @@
#!/bin/sh
set -e
: ${QJS:=build/qjs}
"$QJS" v8.js $* 2>&1 | tee v8.txt$$
diff -uw v8.txt v8.txt$$ || exit 1
rm v8.txt$$
if [ "x" = "x$1" ] ; then
"$QJS" v8.js $* 2>&1 | tee v8.txt$$
diff -uw v8.txt v8.txt$$ || exit 1
rm v8.txt$$
else
"$QJS" v8.js $* 2>&1
fi

270
v8.txt
View file

@ -395,39 +395,6 @@ found:
=== integer-to-string.js
=== intl-numberformat-formattoparts.js
=== intl-pluralrules-select.js
=== invalid-lhs.js
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
threw an exception: invalid assignment left-hand side
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
threw an exception: invalid increment/decrement operand
threw an exception: invalid increment/decrement operand
Object <Error(SyntaxError: invalid for in/of left hand-side)> is not an instance of <ReferenceError> but of <SyntaxError>
threw an exception: invalid for in/of left hand-side
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
threw an exception: invalid assignment left-hand side
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid assignment left-hand side)> is not an instance of <ReferenceError> but of <SyntaxError>
Object <Error(SyntaxError: invalid increment/decrement operand)> is not an instance of <ReferenceError> but of <SyntaxError>
=== invalid-source-element.js
=== json-errors.js
Failure:
@ -508,8 +475,6 @@ Failure: expected <true> found <false>
=== numops-fuzz-part4.js
=== obj-construct.js
=== object-create.js
Failure: expected <true> found <false>
Failure: expected <true> found <false>
=== object-define-properties.js
Failure: expected <undefined> found <1>
=== object-freeze-global.js
@ -543,10 +508,6 @@ Failure (printErr should be defined): expected <"function"> found <"undefined">
=== readonly-accessor.js
=== receiver-in-with-calls.js
=== regexp-UC16.js
=== regexp-cache-replace.js
Failure: expected <"o"> found <undefined>
Failure: expected <"x"> found <undefined>
Failure: expected <"o"> found <undefined>
=== regexp-call-as-function.js
=== regexp-capture.js
Failure: expected <["",undefined,""]> found <["","undefined",""]>
@ -564,35 +525,10 @@ SyntaxError: too many captures
=== regexp-loop-capture.js
Failure: expected <["abc",undefined,undefined,"c"]> found <["abc","a","b","c"]>
Failure: expected <["ab",undefined]> found <["ab","a"]>
=== regexp-modifiers-autogenerated-i18n.js
SyntaxError: invalid group
at regexp-modifiers-autogenerated-i18n.js:12:1
=== regexp-modifiers-autogenerated.js
SyntaxError: invalid group
at regexp-modifiers-autogenerated.js:10:1
=== regexp-modifiers-dotall.js
SyntaxError: invalid group
at regexp-modifiers-dotall.js:9:1
=== regexp-modifiers-i18n.js
SyntaxError: invalid group
at regexp-modifiers-i18n.js:9:1
=== regexp-modifiers.js
SyntaxError: invalid group
at regexp-modifiers.js:7:1
=== regexp-multiline.js
Failure: expected <true> found <false>
Failure: expected <true> found <false>
=== regexp-override-exec.js
=== regexp-override-symbol-match-all.js
TypeError: regexp must have the 'g' flag
at matchAll (native)
at <eval> (regexp-override-symbol-match-all.js:9:23)
=== regexp-override-symbol-match.js
=== regexp-override-symbol-replace.js
=== regexp-override-symbol-search.js
@ -610,10 +546,6 @@ TypeError: regexp must have the 'g' flag
=== scope-calls-eval.js
=== search-string-multiple.js
=== serialize-after-execute.js
=== serialize-embedded-error.js
SyntaxError: invalid assignment left-hand side
at serialize-embedded-error.js:9:1
=== serialize-ic.js
=== shifts.js
=== short-circuit-boolean.js
@ -867,214 +799,12 @@ TypeError: cannot read property 'value' of undefined
=== string-indexof-2.js
=== string-lastindexof.js
=== string-localecompare.js
=== string-match.js
Failure (Nonglobal-$&): expected <"A"> found <undefined>
Failure (Nonglobal-lastMatch): expected <"A"> found <undefined>
Failure (Nonglobal-nocapture-1): expected <""> found <undefined>
Failure (Nonglobal-nocapture-2): expected <""> found <undefined>
Failure (Nonglobal-nocapture-3): expected <""> found <undefined>
Failure (Nonglobal-nocapture-4): expected <""> found <undefined>
Failure (Nonglobal-nocapture-5): expected <""> found <undefined>
Failure (Nonglobal-nocapture-6): expected <""> found <undefined>
Failure (Nonglobal-nocapture-7): expected <""> found <undefined>
Failure (Nonglobal-nocapture-8): expected <""> found <undefined>
Failure (Nonglobal-nocapture-9): expected <""> found <undefined>
Failure (Nonglobal-input): expected <"A man, a plan, a canal: Panama"> found <undefined>
Failure (Nonglobal-$_): expected <"A man, a plan, a canal: Panama"> found <undefined>
Failure (Nonglobal-$`): expected <""> found <undefined>
Failure (Nonglobal-leftContex): expected <""> found <undefined>
Failure (Nonglobal-$'): expected <" man, a plan, a canal: Panama"> found <undefined>
Failure (Nonglobal-rightContex): expected <" man, a plan, a canal: Panama"> found <undefined>
Failure (Nonglobal-$+): expected <""> found <undefined>
Failure (Nonglobal-lastParen): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-$&): expected <"A"> found <undefined>
Failure (Nonglobal-ignore-lastIndex-lastMatch): expected <"A"> found <undefined>
Failure (Nonglobal-ignore-lastIndex-nocapture-1): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-nocapture-2): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-nocapture-3): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-nocapture-4): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-nocapture-5): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-nocapture-6): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-nocapture-7): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-nocapture-8): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-nocapture-9): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-input): expected <"A man, a plan, a canal: Panama"> found <undefined>
Failure (Nonglobal-ignore-lastIndex-$_): expected <"A man, a plan, a canal: Panama"> found <undefined>
Failure (Nonglobal-ignore-lastIndex-$`): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-leftContex): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-$'): expected <" man, a plan, a canal: Panama"> found <undefined>
Failure (Nonglobal-ignore-lastIndex-rightContex): expected <" man, a plan, a canal: Panama"> found <undefined>
Failure (Nonglobal-ignore-lastIndex-$+): expected <""> found <undefined>
Failure (Nonglobal-ignore-lastIndex-lastParen): expected <""> found <undefined>
Failure (Capture-Nonglobal-$&): expected <"abcdefghij"> found <undefined>
Failure (Capture-Nonglobal-lastMatch): expected <"abcdefghij"> found <undefined>
Failure (Capture-Nonglobal-capture-1): expected <"a"> found <undefined>
Failure (Capture-Nonglobal-capture-2): expected <"b"> found <undefined>
Failure (Capture-Nonglobal-capture-3): expected <"c"> found <undefined>
Failure (Capture-Nonglobal-capture-4): expected <"d"> found <undefined>
Failure (Capture-Nonglobal-capture-5): expected <"e"> found <undefined>
Failure (Capture-Nonglobal-capture-6): expected <"f"> found <undefined>
Failure (Capture-Nonglobal-capture-7): expected <"g"> found <undefined>
Failure (Capture-Nonglobal-capture-8): expected <"h"> found <undefined>
Failure (Capture-Nonglobal-capture-9): expected <"i"> found <undefined>
Failure (Capture-Nonglobal-input): expected <"abcdefghijxxxxxxxxxx"> found <undefined>
Failure (Capture-Nonglobal-$_): expected <"abcdefghijxxxxxxxxxx"> found <undefined>
Failure (Capture-Nonglobal-$`): expected <""> found <undefined>
Failure (Capture-Nonglobal-leftContex): expected <""> found <undefined>
Failure (Capture-Nonglobal-$'): expected <"xxxxxxxxxx"> found <undefined>
Failure (Capture-Nonglobal-rightContex): expected <"xxxxxxxxxx"> found <undefined>
Failure (Capture-Nonglobal-$+): expected <"j"> found <undefined>
Failure (Capture-Nonglobal-lastParen): expected <"j"> found <undefined>
Failure (Global-$&): expected <"glyf"> found <undefined>
Failure (Global-lastMatch): expected <"glyf"> found <undefined>
Failure (Global-nocapture-1): expected <""> found <undefined>
Failure (Global-nocapture-2): expected <""> found <undefined>
Failure (Global-nocapture-3): expected <""> found <undefined>
Failure (Global-nocapture-4): expected <""> found <undefined>
Failure (Global-nocapture-5): expected <""> found <undefined>
Failure (Global-nocapture-6): expected <""> found <undefined>
Failure (Global-nocapture-7): expected <""> found <undefined>
Failure (Global-nocapture-8): expected <""> found <undefined>
Failure (Global-nocapture-9): expected <""> found <undefined>
Failure (Global-input): expected <"Argle bargle glop glyf!"> found <undefined>
Failure (Global-$_): expected <"Argle bargle glop glyf!"> found <undefined>
Failure (Global-$`): expected <"Argle bargle glop "> found <undefined>
Failure (Global-leftContex): expected <"Argle bargle glop "> found <undefined>
Failure (Global-$'): expected <"!"> found <undefined>
Failure (Global-rightContex): expected <"!"> found <undefined>
Failure (Global-$+): expected <""> found <undefined>
Failure (Global-lastParen): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-$&): expected <"glyf"> found <undefined>
Failure (Global-ignore-lastIndex-lastMatch): expected <"glyf"> found <undefined>
Failure (Global-ignore-lastIndex-nocapture-1): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-nocapture-2): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-nocapture-3): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-nocapture-4): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-nocapture-5): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-nocapture-6): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-nocapture-7): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-nocapture-8): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-nocapture-9): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-input): expected <"Argle bargle glop glyf!"> found <undefined>
Failure (Global-ignore-lastIndex-$_): expected <"Argle bargle glop glyf!"> found <undefined>
Failure (Global-ignore-lastIndex-$`): expected <"Argle bargle glop "> found <undefined>
Failure (Global-ignore-lastIndex-leftContex): expected <"Argle bargle glop "> found <undefined>
Failure (Global-ignore-lastIndex-$'): expected <"!"> found <undefined>
Failure (Global-ignore-lastIndex-rightContex): expected <"!"> found <undefined>
Failure (Global-ignore-lastIndex-$+): expected <""> found <undefined>
Failure (Global-ignore-lastIndex-lastParen): expected <""> found <undefined>
Failure (Capture-Global-$&): expected <"Panama"> found <undefined>
Failure (Capture-Global-lastMatch): expected <"Panama"> found <undefined>
Failure (Capture-Global-capture-1): expected <"anama"> found <undefined>
Failure (Capture-Global-nocapture-2): expected <""> found <undefined>
<output elided>
=== string-normalize.js
=== string-oom-concat.js
=== string-pad.js
=== string-replace-gc.js
=== string-replace-one-char.js
=== string-search.js
=== string-slices-regexp.js
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
Failure (RegExp.$1): expected <"regexp"> found <undefined>
<output elided>
=== string-split-cache.js
=== string-trim.js
=== string-wrapper.js