From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- js/src/tests/test262/annexB/browser.js | 0 .../test262/annexB/built-ins/Array/browser.js | 0 .../test262/annexB/built-ins/Array/from/browser.js | 0 .../from/iterator-method-emulates-undefined.js | 31 ++++ .../test262/annexB/built-ins/Array/from/shell.js | 0 .../tests/test262/annexB/built-ins/Array/shell.js | 0 .../tests/test262/annexB/built-ins/Date/browser.js | 0 .../annexB/built-ins/Date/prototype/browser.js | 0 .../built-ins/Date/prototype/getYear/B.2.4.js | 18 +++ .../built-ins/Date/prototype/getYear/browser.js | 0 .../built-ins/Date/prototype/getYear/length.js | 32 ++++ .../built-ins/Date/prototype/getYear/name.js | 29 ++++ .../annexB/built-ins/Date/prototype/getYear/nan.js | 17 +++ .../Date/prototype/getYear/not-a-constructor.js | 34 +++++ .../Date/prototype/getYear/return-value.js | 43 ++++++ .../built-ins/Date/prototype/getYear/shell.js | 24 +++ .../Date/prototype/getYear/this-not-date.js | 28 ++++ .../built-ins/Date/prototype/setYear/B.2.5.js | 18 +++ .../built-ins/Date/prototype/setYear/browser.js | 0 .../built-ins/Date/prototype/setYear/length.js | 32 ++++ .../built-ins/Date/prototype/setYear/name.js | 29 ++++ .../Date/prototype/setYear/not-a-constructor.js | 34 +++++ .../built-ins/Date/prototype/setYear/shell.js | 24 +++ .../Date/prototype/setYear/this-not-date.js | 28 ++++ .../Date/prototype/setYear/this-time-nan.js | 20 +++ .../Date/prototype/setYear/this-time-valid.js | 21 +++ .../built-ins/Date/prototype/setYear/time-clip.js | 36 +++++ .../built-ins/Date/prototype/setYear/year-nan.js | 38 +++++ .../Date/prototype/setYear/year-number-absolute.js | 44 ++++++ .../Date/prototype/setYear/year-number-relative.js | 47 ++++++ .../Date/prototype/setYear/year-to-number-err.js | 31 ++++ .../annexB/built-ins/Date/prototype/shell.js | 0 .../Date/prototype/toGMTString/browser.js | 0 .../prototype/toGMTString/not-a-constructor.js | 34 +++++ .../Date/prototype/toGMTString/prop-desc.js | 19 +++ .../built-ins/Date/prototype/toGMTString/shell.js | 24 +++ .../built-ins/Date/prototype/toGMTString/value.js | 16 ++ .../tests/test262/annexB/built-ins/Date/shell.js | 0 .../test262/annexB/built-ins/Function/browser.js | 0 .../createdynfn-html-close-comment-body.js | 22 +++ .../createdynfn-html-close-comment-params.js | 23 +++ .../Function/createdynfn-html-open-comment-body.js | 22 +++ .../createdynfn-html-open-comment-params.js | 23 +++ ...n-no-line-terminator-html-close-comment-body.js | 24 +++ ...no-line-terminator-html-close-comment-params.js | 27 ++++ .../test262/annexB/built-ins/Function/shell.js | 0 .../test262/annexB/built-ins/Object/browser.js | 0 .../test262/annexB/built-ins/Object/is/browser.js | 0 .../built-ins/Object/is/emulates-undefined.js | 28 ++++ .../test262/annexB/built-ins/Object/is/shell.js | 0 .../tests/test262/annexB/built-ins/Object/shell.js | 0 .../RegExp/RegExp-control-escape-russian-letter.js | 55 +++++++ .../RegExp/RegExp-decimal-escape-class-range.js | 31 ++++ .../RegExp/RegExp-decimal-escape-not-capturing.js | 20 +++ ...invalid-control-escape-character-class-range.js | 26 ++++ ...egExp-invalid-control-escape-character-class.js | 56 +++++++ .../built-ins/RegExp/RegExp-leading-escape-BMP.js | 31 ++++ .../built-ins/RegExp/RegExp-leading-escape.js | 16 ++ .../built-ins/RegExp/RegExp-trailing-escape-BMP.js | 31 ++++ .../built-ins/RegExp/RegExp-trailing-escape.js | 16 ++ .../test262/annexB/built-ins/RegExp/browser.js | 0 .../RegExp/incomplete_hex_unicode_escape.js | 20 +++ .../built-ins/RegExp/legacy-accessors/browser.js | 0 .../RegExp/legacy-accessors/index/browser.js | 0 .../RegExp/legacy-accessors/index/prop-desc.js | 35 +++++ .../RegExp/legacy-accessors/index/shell.js | 0 .../index/this-cross-realm-constructor.js | 33 +++++ .../index/this-not-regexp-constructor.js | 63 ++++++++ .../index/this-subclass-constructor.js | 33 +++++ .../RegExp/legacy-accessors/input/browser.js | 0 .../RegExp/legacy-accessors/input/prop-desc.js | 45 ++++++ .../RegExp/legacy-accessors/input/shell.js | 0 .../input/this-cross-realm-constructor.js | 64 ++++++++ .../input/this-not-regexp-constructor.js | 76 ++++++++++ .../input/this-subclass-constructor.js | 64 ++++++++ .../RegExp/legacy-accessors/lastMatch/browser.js | 0 .../RegExp/legacy-accessors/lastMatch/prop-desc.js | 42 ++++++ .../RegExp/legacy-accessors/lastMatch/shell.js | 0 .../lastMatch/this-cross-realm-constructor.js | 38 +++++ .../lastMatch/this-not-regexp-constructor.js | 62 ++++++++ .../lastMatch/this-subclass-constructor.js | 38 +++++ .../RegExp/legacy-accessors/lastParen/browser.js | 0 .../RegExp/legacy-accessors/lastParen/prop-desc.js | 42 ++++++ .../RegExp/legacy-accessors/lastParen/shell.js | 0 .../lastParen/this-cross-realm-constructor.js | 38 +++++ .../lastParen/this-not-regexp-constructor.js | 62 ++++++++ .../lastParen/this-subclass-constructor.js | 38 +++++ .../RegExp/legacy-accessors/leftContext/browser.js | 0 .../legacy-accessors/leftContext/prop-desc.js | 42 ++++++ .../RegExp/legacy-accessors/leftContext/shell.js | 0 .../leftContext/this-cross-realm-constructor.js | 38 +++++ .../leftContext/this-not-regexp-constructor.js | 62 ++++++++ .../leftContext/this-subclass-constructor.js | 38 +++++ .../legacy-accessors/rightContext/browser.js | 0 .../legacy-accessors/rightContext/prop-desc.js | 42 ++++++ .../RegExp/legacy-accessors/rightContext/shell.js | 0 .../rightContext/this-cross-realm-constructor.js | 38 +++++ .../rightContext/this-not-regexp-constructor.js | 62 ++++++++ .../rightContext/this-subclass-constructor.js | 38 +++++ .../built-ins/RegExp/legacy-accessors/shell.js | 0 .../built-ins/RegExp/named-groups/browser.js | 0 .../non-unicode-malformed-lookbehind.js | 17 +++ .../RegExp/named-groups/non-unicode-malformed.js | 27 ++++ .../annexB/built-ins/RegExp/named-groups/shell.js | 0 .../Symbol.match-getter-recompiles-source.js | 37 +++++ .../RegExp/prototype/Symbol.split/browser.js | 0 .../RegExp/prototype/Symbol.split/shell.js | 0 .../toint32-limit-recompiles-source.js | 34 +++++ .../annexB/built-ins/RegExp/prototype/browser.js | 0 .../compile/B.RegExp.prototype.compile.js | 18 +++ .../built-ins/RegExp/prototype/compile/browser.js | 0 .../duplicate-named-capturing-groups-syntax.js | 23 +++ .../prototype/compile/flags-string-invalid.js | 45 ++++++ .../prototype/compile/flags-to-string-err.js | 45 ++++++ .../RegExp/prototype/compile/flags-to-string.js | 41 ++++++ .../RegExp/prototype/compile/flags-undefined.js | 54 +++++++ .../built-ins/RegExp/prototype/compile/length.js | 32 ++++ .../built-ins/RegExp/prototype/compile/name.js | 29 ++++ .../prototype/compile/pattern-regexp-distinct.js | 39 +++++ .../compile/pattern-regexp-flags-defined.js | 46 ++++++ .../compile/pattern-regexp-immutable-lastindex.js | 38 +++++ .../prototype/compile/pattern-regexp-props.js | 75 ++++++++++ .../prototype/compile/pattern-regexp-same.js | 34 +++++ .../prototype/compile/pattern-string-invalid-u.js | 44 ++++++ .../prototype/compile/pattern-string-invalid.js | 46 ++++++ .../RegExp/prototype/compile/pattern-string-u.js | 53 +++++++ .../RegExp/prototype/compile/pattern-string.js | 44 ++++++ .../prototype/compile/pattern-to-string-err.js | 44 ++++++ .../RegExp/prototype/compile/pattern-undefined.js | 53 +++++++ .../built-ins/RegExp/prototype/compile/shell.js | 0 .../prototype/compile/this-cross-realm-instance.js | 37 +++++ .../RegExp/prototype/compile/this-not-object.js | 44 ++++++ .../prototype/compile/this-obj-not-regexp.js | 32 ++++ .../prototype/compile/this-subclass-instance.js | 28 ++++ .../built-ins/RegExp/prototype/flags/browser.js | 0 .../RegExp/prototype/flags/order-after-compile.js | 37 +++++ .../built-ins/RegExp/prototype/flags/shell.js | 0 .../annexB/built-ins/RegExp/prototype/shell.js | 0 .../tests/test262/annexB/built-ins/RegExp/shell.js | 0 .../test262/annexB/built-ins/String/browser.js | 0 .../built-ins/String/prototype/anchor/B.2.3.2.js | 28 ++++ .../String/prototype/anchor/attr-tostring-err.js | 25 ++++ .../built-ins/String/prototype/anchor/browser.js | 0 .../built-ins/String/prototype/anchor/length.js | 32 ++++ .../built-ins/String/prototype/anchor/name.js | 29 ++++ .../String/prototype/anchor/not-a-constructor.js | 34 +++++ .../built-ins/String/prototype/anchor/prop-desc.js | 20 +++ .../built-ins/String/prototype/anchor/shell.js | 24 +++ .../prototype/anchor/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/big/B.2.3.3.js | 25 ++++ .../built-ins/String/prototype/big/browser.js | 0 .../built-ins/String/prototype/big/length.js | 32 ++++ .../annexB/built-ins/String/prototype/big/name.js | 29 ++++ .../String/prototype/big/not-a-constructor.js | 30 ++++ .../built-ins/String/prototype/big/prop-desc.js | 20 +++ .../annexB/built-ins/String/prototype/big/shell.js | 24 +++ .../String/prototype/big/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/blink/B.2.3.4.js | 25 ++++ .../built-ins/String/prototype/blink/browser.js | 0 .../built-ins/String/prototype/blink/length.js | 32 ++++ .../built-ins/String/prototype/blink/name.js | 29 ++++ .../String/prototype/blink/not-a-constructor.js | 34 +++++ .../built-ins/String/prototype/blink/prop-desc.js | 20 +++ .../built-ins/String/prototype/blink/shell.js | 24 +++ .../prototype/blink/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/bold/B.2.3.5.js | 25 ++++ .../built-ins/String/prototype/bold/browser.js | 0 .../built-ins/String/prototype/bold/length.js | 32 ++++ .../annexB/built-ins/String/prototype/bold/name.js | 29 ++++ .../String/prototype/bold/not-a-constructor.js | 34 +++++ .../built-ins/String/prototype/bold/prop-desc.js | 20 +++ .../built-ins/String/prototype/bold/shell.js | 24 +++ .../String/prototype/bold/this-val-tostring-err.js | 24 +++ .../annexB/built-ins/String/prototype/browser.js | 0 .../built-ins/String/prototype/fixed/B.2.3.6.js | 25 ++++ .../built-ins/String/prototype/fixed/browser.js | 0 .../built-ins/String/prototype/fixed/length.js | 32 ++++ .../built-ins/String/prototype/fixed/name.js | 29 ++++ .../String/prototype/fixed/not-a-constructor.js | 34 +++++ .../built-ins/String/prototype/fixed/prop-desc.js | 20 +++ .../built-ins/String/prototype/fixed/shell.js | 24 +++ .../prototype/fixed/this-val-tostring-err.js | 24 +++ .../String/prototype/fontcolor/B.2.3.7.js | 30 ++++ .../prototype/fontcolor/attr-tostring-err.js | 25 ++++ .../String/prototype/fontcolor/browser.js | 0 .../built-ins/String/prototype/fontcolor/length.js | 32 ++++ .../built-ins/String/prototype/fontcolor/name.js | 29 ++++ .../prototype/fontcolor/not-a-constructor.js | 34 +++++ .../String/prototype/fontcolor/prop-desc.js | 20 +++ .../built-ins/String/prototype/fontcolor/shell.js | 24 +++ .../prototype/fontcolor/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/fontsize/B.2.3.8.js | 30 ++++ .../String/prototype/fontsize/attr-tostring-err.js | 25 ++++ .../built-ins/String/prototype/fontsize/browser.js | 0 .../built-ins/String/prototype/fontsize/length.js | 32 ++++ .../built-ins/String/prototype/fontsize/name.js | 29 ++++ .../String/prototype/fontsize/not-a-constructor.js | 34 +++++ .../String/prototype/fontsize/prop-desc.js | 20 +++ .../built-ins/String/prototype/fontsize/shell.js | 24 +++ .../prototype/fontsize/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/italics/B.2.3.9.js | 25 ++++ .../built-ins/String/prototype/italics/browser.js | 0 .../built-ins/String/prototype/italics/length.js | 32 ++++ .../built-ins/String/prototype/italics/name.js | 29 ++++ .../String/prototype/italics/not-a-constructor.js | 34 +++++ .../String/prototype/italics/prop-desc.js | 20 +++ .../built-ins/String/prototype/italics/shell.js | 24 +++ .../prototype/italics/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/link/B.2.3.10.js | 28 ++++ .../String/prototype/link/attr-tostring-err.js | 25 ++++ .../built-ins/String/prototype/link/browser.js | 0 .../built-ins/String/prototype/link/length.js | 32 ++++ .../annexB/built-ins/String/prototype/link/name.js | 29 ++++ .../String/prototype/link/not-a-constructor.js | 34 +++++ .../built-ins/String/prototype/link/prop-desc.js | 20 +++ .../built-ins/String/prototype/link/shell.js | 24 +++ .../String/prototype/link/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/match/browser.js | 0 .../match/custom-matcher-emulates-undefined.js | 31 ++++ .../built-ins/String/prototype/match/shell.js | 0 .../built-ins/String/prototype/matchAll/browser.js | 0 .../matchAll/custom-matcher-emulates-undefined.js | 32 ++++ .../built-ins/String/prototype/matchAll/shell.js | 0 .../built-ins/String/prototype/replace/browser.js | 0 .../replace/custom-replacer-emulates-undefined.js | 31 ++++ .../built-ins/String/prototype/replace/shell.js | 0 .../String/prototype/replaceAll/browser.js | 0 .../custom-replacer-emulates-undefined.js | 32 ++++ .../built-ins/String/prototype/replaceAll/shell.js | 0 .../built-ins/String/prototype/search/browser.js | 0 .../search/custom-searcher-emulates-undefined.js | 31 ++++ .../built-ins/String/prototype/search/shell.js | 0 .../annexB/built-ins/String/prototype/shell.js | 0 .../built-ins/String/prototype/small/B.2.3.11.js | 25 ++++ .../built-ins/String/prototype/small/browser.js | 0 .../built-ins/String/prototype/small/length.js | 32 ++++ .../built-ins/String/prototype/small/name.js | 29 ++++ .../String/prototype/small/not-a-constructor.js | 34 +++++ .../built-ins/String/prototype/small/prop-desc.js | 20 +++ .../built-ins/String/prototype/small/shell.js | 24 +++ .../prototype/small/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/split/browser.js | 0 .../split/custom-splitter-emulates-undefined.js | 31 ++++ .../built-ins/String/prototype/split/shell.js | 0 .../built-ins/String/prototype/strike/B.2.3.12.js | 25 ++++ .../built-ins/String/prototype/strike/browser.js | 0 .../built-ins/String/prototype/strike/length.js | 32 ++++ .../built-ins/String/prototype/strike/name.js | 29 ++++ .../String/prototype/strike/not-a-constructor.js | 34 +++++ .../built-ins/String/prototype/strike/prop-desc.js | 20 +++ .../built-ins/String/prototype/strike/shell.js | 24 +++ .../prototype/strike/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/sub/B.2.3.13.js | 25 ++++ .../built-ins/String/prototype/sub/browser.js | 0 .../built-ins/String/prototype/sub/length.js | 32 ++++ .../annexB/built-ins/String/prototype/sub/name.js | 29 ++++ .../String/prototype/sub/not-a-constructor.js | 30 ++++ .../built-ins/String/prototype/sub/prop-desc.js | 20 +++ .../annexB/built-ins/String/prototype/sub/shell.js | 24 +++ .../String/prototype/sub/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/substr/B.2.3.js | 18 +++ .../built-ins/String/prototype/substr/browser.js | 0 .../String/prototype/substr/length-falsey.js | 39 +++++ .../String/prototype/substr/length-negative.js | 33 +++++ .../String/prototype/substr/length-positive.js | 38 +++++ .../String/prototype/substr/length-to-int-err.js | 29 ++++ .../String/prototype/substr/length-undef.js | 36 +++++ .../built-ins/String/prototype/substr/length.js | 32 ++++ .../built-ins/String/prototype/substr/name.js | 29 ++++ .../String/prototype/substr/not-a-constructor.js | 34 +++++ .../built-ins/String/prototype/substr/shell.js | 24 +++ .../substr/start-and-length-as-numbers.js | 94 ++++++++++++ .../String/prototype/substr/start-negative.js | 19 +++ .../String/prototype/substr/start-to-int-err.js | 37 +++++ .../String/prototype/substr/surrogate-pairs.js | 26 ++++ .../String/prototype/substr/this-non-obj-coerce.js | 23 +++ .../String/prototype/substr/this-to-str-err.js | 23 +++ .../built-ins/String/prototype/sup/B.2.3.14.js | 25 ++++ .../built-ins/String/prototype/sup/browser.js | 0 .../built-ins/String/prototype/sup/length.js | 32 ++++ .../annexB/built-ins/String/prototype/sup/name.js | 29 ++++ .../String/prototype/sup/not-a-constructor.js | 30 ++++ .../built-ins/String/prototype/sup/prop-desc.js | 20 +++ .../annexB/built-ins/String/prototype/sup/shell.js | 24 +++ .../String/prototype/sup/this-val-tostring-err.js | 24 +++ .../built-ins/String/prototype/trimLeft/browser.js | 0 .../built-ins/String/prototype/trimLeft/length.js | 33 +++++ .../built-ins/String/prototype/trimLeft/name.js | 24 +++ .../String/prototype/trimLeft/prop-desc.js | 24 +++ .../prototype/trimLeft/reference-trimStart.js | 19 +++ .../built-ins/String/prototype/trimLeft/shell.js | 0 .../String/prototype/trimRight/browser.js | 0 .../built-ins/String/prototype/trimRight/length.js | 33 +++++ .../built-ins/String/prototype/trimRight/name.js | 23 +++ .../String/prototype/trimRight/prop-desc.js | 24 +++ .../prototype/trimRight/reference-trimEnd.js | 19 +++ .../built-ins/String/prototype/trimRight/shell.js | 0 .../tests/test262/annexB/built-ins/String/shell.js | 0 .../built-ins/TypedArrayConstructors/browser.js | 0 .../TypedArrayConstructors/from/browser.js | 0 .../from/iterator-method-emulates-undefined.js | 37 +++++ .../built-ins/TypedArrayConstructors/from/shell.js | 161 +++++++++++++++++++++ .../built-ins/TypedArrayConstructors/shell.js | 0 js/src/tests/test262/annexB/built-ins/browser.js | 0 .../annexB/built-ins/escape/argument_bigint.js | 18 +++ .../annexB/built-ins/escape/argument_types.js | 35 +++++ .../test262/annexB/built-ins/escape/browser.js | 0 .../annexB/built-ins/escape/empty-string.js | 19 +++ .../annexB/built-ins/escape/escape-above-astral.js | 24 +++ .../annexB/built-ins/escape/escape-above.js | 32 ++++ .../annexB/built-ins/escape/escape-below.js | 56 +++++++ .../test262/annexB/built-ins/escape/length.js | 32 ++++ .../tests/test262/annexB/built-ins/escape/name.js | 29 ++++ .../annexB/built-ins/escape/not-a-constructor.js | 30 ++++ .../test262/annexB/built-ins/escape/prop-desc.js | 21 +++ .../tests/test262/annexB/built-ins/escape/shell.js | 24 +++ .../annexB/built-ins/escape/to-primitive-err.js | 24 +++ .../built-ins/escape/to-primitive-observe.js | 22 +++ .../built-ins/escape/to-string-err-symbol.js | 18 +++ .../annexB/built-ins/escape/to-string-err.js | 21 +++ .../annexB/built-ins/escape/to-string-observe.js | 54 +++++++ .../test262/annexB/built-ins/escape/unmodified.js | 23 +++ js/src/tests/test262/annexB/built-ins/shell.js | 0 .../annexB/built-ins/unescape/argument_bigint.js | 18 +++ .../annexB/built-ins/unescape/argument_types.js | 35 +++++ .../test262/annexB/built-ins/unescape/browser.js | 0 .../annexB/built-ins/unescape/empty-string.js | 19 +++ .../annexB/built-ins/unescape/four-ignore-bad-u.js | 30 ++++ .../built-ins/unescape/four-ignore-end-str.js | 96 ++++++++++++ .../built-ins/unescape/four-ignore-non-hex.js | 45 ++++++ .../test262/annexB/built-ins/unescape/four.js | 75 ++++++++++ .../test262/annexB/built-ins/unescape/length.js | 32 ++++ .../test262/annexB/built-ins/unescape/name.js | 29 ++++ .../annexB/built-ins/unescape/not-a-constructor.js | 30 ++++ .../test262/annexB/built-ins/unescape/prop-desc.js | 21 +++ .../test262/annexB/built-ins/unescape/shell.js | 24 +++ .../annexB/built-ins/unescape/to-primitive-err.js | 24 +++ .../built-ins/unescape/to-primitive-observe.js | 22 +++ .../built-ins/unescape/to-string-err-symbol.js | 18 +++ .../annexB/built-ins/unescape/to-string-err.js | 21 +++ .../annexB/built-ins/unescape/to-string-observe.js | 54 +++++++ .../built-ins/unescape/two-ignore-end-str.js | 49 +++++++ .../built-ins/unescape/two-ignore-non-hex.js | 37 +++++ .../tests/test262/annexB/built-ins/unescape/two.js | 71 +++++++++ js/src/tests/test262/annexB/language/browser.js | 0 .../test262/annexB/language/comments/browser.js | 0 .../language/comments/multi-line-html-close.js | 90 ++++++++++++ .../test262/annexB/language/comments/shell.js | 0 .../comments/single-line-html-close-asi.js | 39 +++++ .../single-line-html-close-unicode-separators.js | 52 +++++++ .../language/comments/single-line-html-close.js | 50 +++++++ .../language/comments/single-line-html-open.js | 44 ++++++ .../test262/annexB/language/eval-code/browser.js | 0 .../eval-code/direct/block-decl-nostrict.js | 29 ++++ .../annexB/language/eval-code/direct/browser.js | 0 .../func-block-decl-eval-func-block-scoping.js | 48 ++++++ ...ock-decl-eval-func-existing-block-fn-no-init.js | 29 ++++ ...lock-decl-eval-func-existing-block-fn-update.js | 38 +++++ ...unc-block-decl-eval-func-existing-fn-no-init.js | 35 +++++ ...func-block-decl-eval-func-existing-fn-update.js | 38 +++++ ...nc-block-decl-eval-func-existing-var-no-init.js | 26 ++++ ...unc-block-decl-eval-func-existing-var-update.js | 37 +++++ .../direct/func-block-decl-eval-func-init.js | 38 +++++ .../func-block-decl-eval-func-no-skip-param.js | 30 ++++ .../func-block-decl-eval-func-no-skip-try.js | 46 ++++++ ...nc-block-decl-eval-func-skip-early-err-block.js | 43 ++++++ ...c-block-decl-eval-func-skip-early-err-for-in.js | 42 ++++++ ...c-block-decl-eval-func-skip-early-err-for-of.js | 42 ++++++ ...func-block-decl-eval-func-skip-early-err-for.js | 43 ++++++ ...c-block-decl-eval-func-skip-early-err-switch.js | 44 ++++++ ...func-block-decl-eval-func-skip-early-err-try.js | 53 +++++++ .../func-block-decl-eval-func-skip-early-err.js | 29 ++++ .../direct/func-block-decl-eval-func-update.js | 34 +++++ ...-if-decl-else-decl-a-eval-func-block-scoping.js | 57 ++++++++ ...e-decl-a-eval-func-existing-block-fn-no-init.js | 38 +++++ ...se-decl-a-eval-func-existing-block-fn-update.js | 47 ++++++ ...cl-else-decl-a-eval-func-existing-fn-no-init.js | 44 ++++++ ...ecl-else-decl-a-eval-func-existing-fn-update.js | 47 ++++++ ...l-else-decl-a-eval-func-existing-var-no-init.js | 35 +++++ ...cl-else-decl-a-eval-func-existing-var-update.js | 46 ++++++ .../func-if-decl-else-decl-a-eval-func-init.js | 47 ++++++ ...-if-decl-else-decl-a-eval-func-no-skip-param.js | 39 +++++ ...nc-if-decl-else-decl-a-eval-func-no-skip-try.js | 55 +++++++ ...l-else-decl-a-eval-func-skip-early-err-block.js | 52 +++++++ ...-else-decl-a-eval-func-skip-early-err-for-in.js | 51 +++++++ ...-else-decl-a-eval-func-skip-early-err-for-of.js | 51 +++++++ ...ecl-else-decl-a-eval-func-skip-early-err-for.js | 52 +++++++ ...-else-decl-a-eval-func-skip-early-err-switch.js | 53 +++++++ ...ecl-else-decl-a-eval-func-skip-early-err-try.js | 62 ++++++++ ...if-decl-else-decl-a-eval-func-skip-early-err.js | 38 +++++ .../func-if-decl-else-decl-a-eval-func-update.js | 43 ++++++ ...-if-decl-else-decl-b-eval-func-block-scoping.js | 57 ++++++++ ...e-decl-b-eval-func-existing-block-fn-no-init.js | 38 +++++ ...se-decl-b-eval-func-existing-block-fn-update.js | 47 ++++++ ...cl-else-decl-b-eval-func-existing-fn-no-init.js | 44 ++++++ ...ecl-else-decl-b-eval-func-existing-fn-update.js | 47 ++++++ ...l-else-decl-b-eval-func-existing-var-no-init.js | 35 +++++ ...cl-else-decl-b-eval-func-existing-var-update.js | 46 ++++++ .../func-if-decl-else-decl-b-eval-func-init.js | 47 ++++++ ...-if-decl-else-decl-b-eval-func-no-skip-param.js | 39 +++++ ...nc-if-decl-else-decl-b-eval-func-no-skip-try.js | 55 +++++++ ...l-else-decl-b-eval-func-skip-early-err-block.js | 52 +++++++ ...-else-decl-b-eval-func-skip-early-err-for-in.js | 51 +++++++ ...-else-decl-b-eval-func-skip-early-err-for-of.js | 51 +++++++ ...ecl-else-decl-b-eval-func-skip-early-err-for.js | 52 +++++++ ...-else-decl-b-eval-func-skip-early-err-switch.js | 53 +++++++ ...ecl-else-decl-b-eval-func-skip-early-err-try.js | 62 ++++++++ ...if-decl-else-decl-b-eval-func-skip-early-err.js | 38 +++++ .../func-if-decl-else-decl-b-eval-func-update.js | 43 ++++++ ...nc-if-decl-else-stmt-eval-func-block-scoping.js | 57 ++++++++ ...lse-stmt-eval-func-existing-block-fn-no-init.js | 38 +++++ ...else-stmt-eval-func-existing-block-fn-update.js | 47 ++++++ ...decl-else-stmt-eval-func-existing-fn-no-init.js | 44 ++++++ ...-decl-else-stmt-eval-func-existing-fn-update.js | 47 ++++++ ...ecl-else-stmt-eval-func-existing-var-no-init.js | 35 +++++ ...decl-else-stmt-eval-func-existing-var-update.js | 46 ++++++ .../func-if-decl-else-stmt-eval-func-init.js | 47 ++++++ ...nc-if-decl-else-stmt-eval-func-no-skip-param.js | 39 +++++ ...func-if-decl-else-stmt-eval-func-no-skip-try.js | 55 +++++++ ...ecl-else-stmt-eval-func-skip-early-err-block.js | 52 +++++++ ...cl-else-stmt-eval-func-skip-early-err-for-in.js | 51 +++++++ ...cl-else-stmt-eval-func-skip-early-err-for-of.js | 51 +++++++ ...-decl-else-stmt-eval-func-skip-early-err-for.js | 52 +++++++ ...cl-else-stmt-eval-func-skip-early-err-switch.js | 53 +++++++ ...-decl-else-stmt-eval-func-skip-early-err-try.js | 62 ++++++++ ...c-if-decl-else-stmt-eval-func-skip-early-err.js | 38 +++++ .../func-if-decl-else-stmt-eval-func-update.js | 43 ++++++ ...func-if-decl-no-else-eval-func-block-scoping.js | 57 ++++++++ ...-no-else-eval-func-existing-block-fn-no-init.js | 38 +++++ ...l-no-else-eval-func-existing-block-fn-update.js | 47 ++++++ ...f-decl-no-else-eval-func-existing-fn-no-init.js | 44 ++++++ ...if-decl-no-else-eval-func-existing-fn-update.js | 47 ++++++ ...-decl-no-else-eval-func-existing-var-no-init.js | 35 +++++ ...f-decl-no-else-eval-func-existing-var-update.js | 46 ++++++ .../direct/func-if-decl-no-else-eval-func-init.js | 47 ++++++ ...func-if-decl-no-else-eval-func-no-skip-param.js | 39 +++++ .../func-if-decl-no-else-eval-func-no-skip-try.js | 55 +++++++ ...-decl-no-else-eval-func-skip-early-err-block.js | 52 +++++++ ...decl-no-else-eval-func-skip-early-err-for-in.js | 51 +++++++ ...decl-no-else-eval-func-skip-early-err-for-of.js | 51 +++++++ ...if-decl-no-else-eval-func-skip-early-err-for.js | 52 +++++++ ...decl-no-else-eval-func-skip-early-err-switch.js | 53 +++++++ ...if-decl-no-else-eval-func-skip-early-err-try.js | 62 ++++++++ ...unc-if-decl-no-else-eval-func-skip-early-err.js | 38 +++++ .../func-if-decl-no-else-eval-func-update.js | 43 ++++++ ...nc-if-stmt-else-decl-eval-func-block-scoping.js | 57 ++++++++ ...lse-decl-eval-func-existing-block-fn-no-init.js | 38 +++++ ...else-decl-eval-func-existing-block-fn-update.js | 47 ++++++ ...stmt-else-decl-eval-func-existing-fn-no-init.js | 44 ++++++ ...-stmt-else-decl-eval-func-existing-fn-update.js | 47 ++++++ ...tmt-else-decl-eval-func-existing-var-no-init.js | 35 +++++ ...stmt-else-decl-eval-func-existing-var-update.js | 46 ++++++ .../func-if-stmt-else-decl-eval-func-init.js | 47 ++++++ ...nc-if-stmt-else-decl-eval-func-no-skip-param.js | 39 +++++ ...func-if-stmt-else-decl-eval-func-no-skip-try.js | 55 +++++++ ...tmt-else-decl-eval-func-skip-early-err-block.js | 52 +++++++ ...mt-else-decl-eval-func-skip-early-err-for-in.js | 51 +++++++ ...mt-else-decl-eval-func-skip-early-err-for-of.js | 51 +++++++ ...-stmt-else-decl-eval-func-skip-early-err-for.js | 52 +++++++ ...mt-else-decl-eval-func-skip-early-err-switch.js | 53 +++++++ ...-stmt-else-decl-eval-func-skip-early-err-try.js | 62 ++++++++ ...c-if-stmt-else-decl-eval-func-skip-early-err.js | 38 +++++ .../func-if-stmt-else-decl-eval-func-update.js | 43 ++++++ .../func-switch-case-eval-func-block-scoping.js | 52 +++++++ ...tch-case-eval-func-existing-block-fn-no-init.js | 33 +++++ ...itch-case-eval-func-existing-block-fn-update.js | 42 ++++++ ...nc-switch-case-eval-func-existing-fn-no-init.js | 39 +++++ ...unc-switch-case-eval-func-existing-fn-update.js | 42 ++++++ ...c-switch-case-eval-func-existing-var-no-init.js | 30 ++++ ...nc-switch-case-eval-func-existing-var-update.js | 41 ++++++ .../direct/func-switch-case-eval-func-init.js | 42 ++++++ .../func-switch-case-eval-func-no-skip-param.js | 34 +++++ .../func-switch-case-eval-func-no-skip-try.js | 50 +++++++ ...c-switch-case-eval-func-skip-early-err-block.js | 47 ++++++ ...-switch-case-eval-func-skip-early-err-for-in.js | 46 ++++++ ...-switch-case-eval-func-skip-early-err-for-of.js | 46 ++++++ ...unc-switch-case-eval-func-skip-early-err-for.js | 47 ++++++ ...-switch-case-eval-func-skip-early-err-switch.js | 48 ++++++ ...unc-switch-case-eval-func-skip-early-err-try.js | 57 ++++++++ .../func-switch-case-eval-func-skip-early-err.js | 33 +++++ .../direct/func-switch-case-eval-func-update.js | 38 +++++ .../func-switch-dflt-eval-func-block-scoping.js | 52 +++++++ ...tch-dflt-eval-func-existing-block-fn-no-init.js | 33 +++++ ...itch-dflt-eval-func-existing-block-fn-update.js | 42 ++++++ ...nc-switch-dflt-eval-func-existing-fn-no-init.js | 39 +++++ ...unc-switch-dflt-eval-func-existing-fn-update.js | 42 ++++++ ...c-switch-dflt-eval-func-existing-var-no-init.js | 30 ++++ ...nc-switch-dflt-eval-func-existing-var-update.js | 41 ++++++ .../direct/func-switch-dflt-eval-func-init.js | 42 ++++++ .../func-switch-dflt-eval-func-no-skip-param.js | 34 +++++ .../func-switch-dflt-eval-func-no-skip-try.js | 50 +++++++ ...c-switch-dflt-eval-func-skip-early-err-block.js | 47 ++++++ ...-switch-dflt-eval-func-skip-early-err-for-in.js | 46 ++++++ ...-switch-dflt-eval-func-skip-early-err-for-of.js | 46 ++++++ ...unc-switch-dflt-eval-func-skip-early-err-for.js | 47 ++++++ ...-switch-dflt-eval-func-skip-early-err-switch.js | 48 ++++++ ...unc-switch-dflt-eval-func-skip-early-err-try.js | 57 ++++++++ .../func-switch-dflt-eval-func-skip-early-err.js | 33 +++++ .../direct/func-switch-dflt-eval-func-update.js | 38 +++++ .../global-block-decl-eval-global-block-scoping.js | 46 ++++++ ...k-decl-eval-global-existing-block-fn-no-init.js | 24 +++ ...ck-decl-eval-global-existing-block-fn-update.js | 36 +++++ ...l-block-decl-eval-global-existing-fn-no-init.js | 22 +++ ...al-block-decl-eval-global-existing-fn-update.js | 33 +++++ ...-block-decl-eval-global-existing-global-init.js | 43 ++++++ ...lock-decl-eval-global-existing-global-update.js | 39 +++++ ...l-global-existing-non-enumerable-global-init.js | 43 ++++++ ...-block-decl-eval-global-existing-var-no-init.js | 21 +++ ...l-block-decl-eval-global-existing-var-update.js | 33 +++++ .../direct/global-block-decl-eval-global-init.js | 30 ++++ .../global-block-decl-eval-global-no-skip-try.js | 44 ++++++ ...-block-decl-eval-global-skip-early-err-block.js | 40 +++++ ...block-decl-eval-global-skip-early-err-for-in.js | 39 +++++ ...block-decl-eval-global-skip-early-err-for-of.js | 39 +++++ ...al-block-decl-eval-global-skip-early-err-for.js | 40 +++++ ...block-decl-eval-global-skip-early-err-switch.js | 41 ++++++ ...al-block-decl-eval-global-skip-early-err-try.js | 51 +++++++ ...global-block-decl-eval-global-skip-early-err.js | 23 +++ .../direct/global-block-decl-eval-global-update.js | 29 ++++ ...f-decl-else-decl-a-eval-global-block-scoping.js | 55 +++++++ ...decl-a-eval-global-existing-block-fn-no-init.js | 33 +++++ ...-decl-a-eval-global-existing-block-fn-update.js | 45 ++++++ ...-else-decl-a-eval-global-existing-fn-no-init.js | 31 ++++ ...l-else-decl-a-eval-global-existing-fn-update.js | 42 ++++++ ...else-decl-a-eval-global-existing-global-init.js | 52 +++++++ ...se-decl-a-eval-global-existing-global-update.js | 48 ++++++ ...l-global-existing-non-enumerable-global-init.js | 52 +++++++ ...else-decl-a-eval-global-existing-var-no-init.js | 30 ++++ ...-else-decl-a-eval-global-existing-var-update.js | 42 ++++++ .../global-if-decl-else-decl-a-eval-global-init.js | 39 +++++ ...-if-decl-else-decl-a-eval-global-no-skip-try.js | 53 +++++++ ...else-decl-a-eval-global-skip-early-err-block.js | 49 +++++++ ...lse-decl-a-eval-global-skip-early-err-for-in.js | 48 ++++++ ...lse-decl-a-eval-global-skip-early-err-for-of.js | 48 ++++++ ...l-else-decl-a-eval-global-skip-early-err-for.js | 49 +++++++ ...lse-decl-a-eval-global-skip-early-err-switch.js | 50 +++++++ ...l-else-decl-a-eval-global-skip-early-err-try.js | 60 ++++++++ ...-decl-else-decl-a-eval-global-skip-early-err.js | 32 ++++ ...lobal-if-decl-else-decl-a-eval-global-update.js | 38 +++++ ...f-decl-else-decl-b-eval-global-block-scoping.js | 55 +++++++ ...decl-b-eval-global-existing-block-fn-no-init.js | 33 +++++ ...-decl-b-eval-global-existing-block-fn-update.js | 45 ++++++ ...-else-decl-b-eval-global-existing-fn-no-init.js | 31 ++++ ...l-else-decl-b-eval-global-existing-fn-update.js | 42 ++++++ ...else-decl-b-eval-global-existing-global-init.js | 52 +++++++ ...se-decl-b-eval-global-existing-global-update.js | 48 ++++++ ...l-global-existing-non-enumerable-global-init.js | 52 +++++++ ...else-decl-b-eval-global-existing-var-no-init.js | 30 ++++ ...-else-decl-b-eval-global-existing-var-update.js | 42 ++++++ .../global-if-decl-else-decl-b-eval-global-init.js | 39 +++++ ...-if-decl-else-decl-b-eval-global-no-skip-try.js | 53 +++++++ ...else-decl-b-eval-global-skip-early-err-block.js | 49 +++++++ ...lse-decl-b-eval-global-skip-early-err-for-in.js | 48 ++++++ ...lse-decl-b-eval-global-skip-early-err-for-of.js | 48 ++++++ ...l-else-decl-b-eval-global-skip-early-err-for.js | 49 +++++++ ...lse-decl-b-eval-global-skip-early-err-switch.js | 50 +++++++ ...l-else-decl-b-eval-global-skip-early-err-try.js | 60 ++++++++ ...-decl-else-decl-b-eval-global-skip-early-err.js | 32 ++++ ...lobal-if-decl-else-decl-b-eval-global-update.js | 38 +++++ ...-if-decl-else-stmt-eval-global-block-scoping.js | 55 +++++++ ...e-stmt-eval-global-existing-block-fn-no-init.js | 33 +++++ ...se-stmt-eval-global-existing-block-fn-update.js | 45 ++++++ ...cl-else-stmt-eval-global-existing-fn-no-init.js | 31 ++++ ...ecl-else-stmt-eval-global-existing-fn-update.js | 42 ++++++ ...l-else-stmt-eval-global-existing-global-init.js | 52 +++++++ ...else-stmt-eval-global-existing-global-update.js | 48 ++++++ ...l-global-existing-non-enumerable-global-init.js | 52 +++++++ ...l-else-stmt-eval-global-existing-var-no-init.js | 30 ++++ ...cl-else-stmt-eval-global-existing-var-update.js | 42 ++++++ .../global-if-decl-else-stmt-eval-global-init.js | 39 +++++ ...al-if-decl-else-stmt-eval-global-no-skip-try.js | 53 +++++++ ...l-else-stmt-eval-global-skip-early-err-block.js | 49 +++++++ ...-else-stmt-eval-global-skip-early-err-for-in.js | 48 ++++++ ...-else-stmt-eval-global-skip-early-err-for-of.js | 48 ++++++ ...ecl-else-stmt-eval-global-skip-early-err-for.js | 49 +++++++ ...-else-stmt-eval-global-skip-early-err-switch.js | 50 +++++++ ...ecl-else-stmt-eval-global-skip-early-err-try.js | 60 ++++++++ ...if-decl-else-stmt-eval-global-skip-early-err.js | 32 ++++ .../global-if-decl-else-stmt-eval-global-update.js | 38 +++++ ...al-if-decl-no-else-eval-global-block-scoping.js | 55 +++++++ ...o-else-eval-global-existing-block-fn-no-init.js | 33 +++++ ...no-else-eval-global-existing-block-fn-update.js | 45 ++++++ ...decl-no-else-eval-global-existing-fn-no-init.js | 31 ++++ ...-decl-no-else-eval-global-existing-fn-update.js | 42 ++++++ ...ecl-no-else-eval-global-existing-global-init.js | 52 +++++++ ...l-no-else-eval-global-existing-global-update.js | 48 ++++++ ...l-global-existing-non-enumerable-global-init.js | 52 +++++++ ...ecl-no-else-eval-global-existing-var-no-init.js | 30 ++++ ...decl-no-else-eval-global-existing-var-update.js | 42 ++++++ .../global-if-decl-no-else-eval-global-init.js | 39 +++++ ...obal-if-decl-no-else-eval-global-no-skip-try.js | 53 +++++++ ...ecl-no-else-eval-global-skip-early-err-block.js | 49 +++++++ ...cl-no-else-eval-global-skip-early-err-for-in.js | 48 ++++++ ...cl-no-else-eval-global-skip-early-err-for-of.js | 48 ++++++ ...-decl-no-else-eval-global-skip-early-err-for.js | 49 +++++++ ...cl-no-else-eval-global-skip-early-err-switch.js | 50 +++++++ ...-decl-no-else-eval-global-skip-early-err-try.js | 60 ++++++++ ...l-if-decl-no-else-eval-global-skip-early-err.js | 32 ++++ .../global-if-decl-no-else-eval-global-update.js | 38 +++++ ...-if-stmt-else-decl-eval-global-block-scoping.js | 55 +++++++ ...e-decl-eval-global-existing-block-fn-no-init.js | 33 +++++ ...se-decl-eval-global-existing-block-fn-update.js | 45 ++++++ ...mt-else-decl-eval-global-existing-fn-no-init.js | 31 ++++ ...tmt-else-decl-eval-global-existing-fn-update.js | 42 ++++++ ...t-else-decl-eval-global-existing-global-init.js | 52 +++++++ ...else-decl-eval-global-existing-global-update.js | 48 ++++++ ...l-global-existing-non-enumerable-global-init.js | 52 +++++++ ...t-else-decl-eval-global-existing-var-no-init.js | 30 ++++ ...mt-else-decl-eval-global-existing-var-update.js | 42 ++++++ .../global-if-stmt-else-decl-eval-global-init.js | 39 +++++ ...al-if-stmt-else-decl-eval-global-no-skip-try.js | 53 +++++++ ...t-else-decl-eval-global-skip-early-err-block.js | 49 +++++++ ...-else-decl-eval-global-skip-early-err-for-in.js | 48 ++++++ ...-else-decl-eval-global-skip-early-err-for-of.js | 48 ++++++ ...tmt-else-decl-eval-global-skip-early-err-for.js | 49 +++++++ ...-else-decl-eval-global-skip-early-err-switch.js | 50 +++++++ ...tmt-else-decl-eval-global-skip-early-err-try.js | 60 ++++++++ ...if-stmt-else-decl-eval-global-skip-early-err.js | 32 ++++ .../global-if-stmt-else-decl-eval-global-update.js | 38 +++++ ...global-switch-case-eval-global-block-scoping.js | 50 +++++++ ...h-case-eval-global-existing-block-fn-no-init.js | 28 ++++ ...ch-case-eval-global-existing-block-fn-update.js | 40 +++++ ...-switch-case-eval-global-existing-fn-no-init.js | 26 ++++ ...l-switch-case-eval-global-existing-fn-update.js | 37 +++++ ...switch-case-eval-global-existing-global-init.js | 47 ++++++ ...itch-case-eval-global-existing-global-update.js | 43 ++++++ ...l-global-existing-non-enumerable-global-init.js | 47 ++++++ ...switch-case-eval-global-existing-var-no-init.js | 25 ++++ ...-switch-case-eval-global-existing-var-update.js | 37 +++++ .../direct/global-switch-case-eval-global-init.js | 34 +++++ .../global-switch-case-eval-global-no-skip-try.js | 48 ++++++ ...switch-case-eval-global-skip-early-err-block.js | 44 ++++++ ...witch-case-eval-global-skip-early-err-for-in.js | 43 ++++++ ...witch-case-eval-global-skip-early-err-for-of.js | 43 ++++++ ...l-switch-case-eval-global-skip-early-err-for.js | 44 ++++++ ...witch-case-eval-global-skip-early-err-switch.js | 45 ++++++ ...l-switch-case-eval-global-skip-early-err-try.js | 55 +++++++ ...lobal-switch-case-eval-global-skip-early-err.js | 27 ++++ .../global-switch-case-eval-global-update.js | 33 +++++ ...global-switch-dflt-eval-global-block-scoping.js | 50 +++++++ ...h-dflt-eval-global-existing-block-fn-no-init.js | 28 ++++ ...ch-dflt-eval-global-existing-block-fn-update.js | 40 +++++ ...-switch-dflt-eval-global-existing-fn-no-init.js | 26 ++++ ...l-switch-dflt-eval-global-existing-fn-update.js | 37 +++++ ...switch-dflt-eval-global-existing-global-init.js | 47 ++++++ ...itch-dflt-eval-global-existing-global-update.js | 43 ++++++ ...l-global-existing-non-enumerable-global-init.js | 47 ++++++ ...switch-dflt-eval-global-existing-var-no-init.js | 25 ++++ ...-switch-dflt-eval-global-existing-var-update.js | 37 +++++ .../direct/global-switch-dflt-eval-global-init.js | 34 +++++ .../global-switch-dflt-eval-global-no-skip-try.js | 48 ++++++ ...switch-dflt-eval-global-skip-early-err-block.js | 44 ++++++ ...witch-dflt-eval-global-skip-early-err-for-in.js | 43 ++++++ ...witch-dflt-eval-global-skip-early-err-for-of.js | 43 ++++++ ...l-switch-dflt-eval-global-skip-early-err-for.js | 44 ++++++ ...witch-dflt-eval-global-skip-early-err-switch.js | 45 ++++++ ...l-switch-dflt-eval-global-skip-early-err-try.js | 55 +++++++ ...lobal-switch-dflt-eval-global-skip-early-err.js | 27 ++++ .../global-switch-dflt-eval-global-update.js | 33 +++++ .../script-decl-lex-collision-in-sloppy-mode.js | 23 +++ ...-decl-lex-no-collision-in-strict-mode-strict.js | 24 +++ .../annexB/language/eval-code/direct/shell.js | 14 ++ .../eval-code/direct/switch-case-decl-nostrict.js | 34 +++++ .../eval-code/direct/switch-dflt-decl-nostrict.js | 34 +++++ .../direct/var-env-lower-lex-catch-non-strict.js | 34 +++++ .../annexB/language/eval-code/indirect/browser.js | 0 .../global-block-decl-eval-global-block-scoping.js | 46 ++++++ ...k-decl-eval-global-existing-block-fn-no-init.js | 24 +++ ...ck-decl-eval-global-existing-block-fn-update.js | 36 +++++ ...l-block-decl-eval-global-existing-fn-no-init.js | 22 +++ ...al-block-decl-eval-global-existing-fn-update.js | 33 +++++ ...-block-decl-eval-global-existing-global-init.js | 43 ++++++ ...lock-decl-eval-global-existing-global-update.js | 39 +++++ ...l-global-existing-non-enumerable-global-init.js | 43 ++++++ ...-block-decl-eval-global-existing-var-no-init.js | 21 +++ ...l-block-decl-eval-global-existing-var-update.js | 33 +++++ .../indirect/global-block-decl-eval-global-init.js | 30 ++++ .../global-block-decl-eval-global-no-skip-try.js | 44 ++++++ ...-block-decl-eval-global-skip-early-err-block.js | 40 +++++ ...block-decl-eval-global-skip-early-err-for-in.js | 39 +++++ ...block-decl-eval-global-skip-early-err-for-of.js | 39 +++++ ...al-block-decl-eval-global-skip-early-err-for.js | 40 +++++ ...block-decl-eval-global-skip-early-err-switch.js | 41 ++++++ ...al-block-decl-eval-global-skip-early-err-try.js | 51 +++++++ ...global-block-decl-eval-global-skip-early-err.js | 23 +++ .../global-block-decl-eval-global-update.js | 29 ++++ ...f-decl-else-decl-a-eval-global-block-scoping.js | 55 +++++++ ...decl-a-eval-global-existing-block-fn-no-init.js | 33 +++++ ...-decl-a-eval-global-existing-block-fn-update.js | 45 ++++++ ...-else-decl-a-eval-global-existing-fn-no-init.js | 31 ++++ ...l-else-decl-a-eval-global-existing-fn-update.js | 42 ++++++ ...else-decl-a-eval-global-existing-global-init.js | 52 +++++++ ...se-decl-a-eval-global-existing-global-update.js | 48 ++++++ ...l-global-existing-non-enumerable-global-init.js | 52 +++++++ ...else-decl-a-eval-global-existing-var-no-init.js | 30 ++++ ...-else-decl-a-eval-global-existing-var-update.js | 42 ++++++ .../global-if-decl-else-decl-a-eval-global-init.js | 39 +++++ ...-if-decl-else-decl-a-eval-global-no-skip-try.js | 53 +++++++ ...else-decl-a-eval-global-skip-early-err-block.js | 49 +++++++ ...lse-decl-a-eval-global-skip-early-err-for-in.js | 48 ++++++ ...lse-decl-a-eval-global-skip-early-err-for-of.js | 48 ++++++ ...l-else-decl-a-eval-global-skip-early-err-for.js | 49 +++++++ ...lse-decl-a-eval-global-skip-early-err-switch.js | 50 +++++++ ...l-else-decl-a-eval-global-skip-early-err-try.js | 60 ++++++++ ...-decl-else-decl-a-eval-global-skip-early-err.js | 32 ++++ ...lobal-if-decl-else-decl-a-eval-global-update.js | 38 +++++ ...f-decl-else-decl-b-eval-global-block-scoping.js | 55 +++++++ ...decl-b-eval-global-existing-block-fn-no-init.js | 33 +++++ ...-decl-b-eval-global-existing-block-fn-update.js | 45 ++++++ ...-else-decl-b-eval-global-existing-fn-no-init.js | 31 ++++ ...l-else-decl-b-eval-global-existing-fn-update.js | 42 ++++++ ...else-decl-b-eval-global-existing-global-init.js | 52 +++++++ ...se-decl-b-eval-global-existing-global-update.js | 48 ++++++ ...l-global-existing-non-enumerable-global-init.js | 52 +++++++ ...else-decl-b-eval-global-existing-var-no-init.js | 30 ++++ ...-else-decl-b-eval-global-existing-var-update.js | 42 ++++++ .../global-if-decl-else-decl-b-eval-global-init.js | 39 +++++ ...-if-decl-else-decl-b-eval-global-no-skip-try.js | 53 +++++++ ...else-decl-b-eval-global-skip-early-err-block.js | 49 +++++++ ...lse-decl-b-eval-global-skip-early-err-for-in.js | 48 ++++++ ...lse-decl-b-eval-global-skip-early-err-for-of.js | 48 ++++++ ...l-else-decl-b-eval-global-skip-early-err-for.js | 49 +++++++ ...lse-decl-b-eval-global-skip-early-err-switch.js | 50 +++++++ ...l-else-decl-b-eval-global-skip-early-err-try.js | 60 ++++++++ ...-decl-else-decl-b-eval-global-skip-early-err.js | 32 ++++ ...lobal-if-decl-else-decl-b-eval-global-update.js | 38 +++++ ...-if-decl-else-stmt-eval-global-block-scoping.js | 55 +++++++ ...e-stmt-eval-global-existing-block-fn-no-init.js | 33 +++++ ...se-stmt-eval-global-existing-block-fn-update.js | 45 ++++++ ...cl-else-stmt-eval-global-existing-fn-no-init.js | 31 ++++ ...ecl-else-stmt-eval-global-existing-fn-update.js | 42 ++++++ ...l-else-stmt-eval-global-existing-global-init.js | 52 +++++++ ...else-stmt-eval-global-existing-global-update.js | 48 ++++++ ...l-global-existing-non-enumerable-global-init.js | 52 +++++++ ...l-else-stmt-eval-global-existing-var-no-init.js | 30 ++++ ...cl-else-stmt-eval-global-existing-var-update.js | 42 ++++++ .../global-if-decl-else-stmt-eval-global-init.js | 39 +++++ ...al-if-decl-else-stmt-eval-global-no-skip-try.js | 53 +++++++ ...l-else-stmt-eval-global-skip-early-err-block.js | 49 +++++++ ...-else-stmt-eval-global-skip-early-err-for-in.js | 48 ++++++ ...-else-stmt-eval-global-skip-early-err-for-of.js | 48 ++++++ ...ecl-else-stmt-eval-global-skip-early-err-for.js | 49 +++++++ ...-else-stmt-eval-global-skip-early-err-switch.js | 50 +++++++ ...ecl-else-stmt-eval-global-skip-early-err-try.js | 60 ++++++++ ...if-decl-else-stmt-eval-global-skip-early-err.js | 32 ++++ .../global-if-decl-else-stmt-eval-global-update.js | 38 +++++ ...al-if-decl-no-else-eval-global-block-scoping.js | 55 +++++++ ...o-else-eval-global-existing-block-fn-no-init.js | 33 +++++ ...no-else-eval-global-existing-block-fn-update.js | 45 ++++++ ...decl-no-else-eval-global-existing-fn-no-init.js | 31 ++++ ...-decl-no-else-eval-global-existing-fn-update.js | 42 ++++++ ...ecl-no-else-eval-global-existing-global-init.js | 52 +++++++ ...l-no-else-eval-global-existing-global-update.js | 48 ++++++ ...l-global-existing-non-enumerable-global-init.js | 52 +++++++ ...ecl-no-else-eval-global-existing-var-no-init.js | 30 ++++ ...decl-no-else-eval-global-existing-var-update.js | 42 ++++++ .../global-if-decl-no-else-eval-global-init.js | 39 +++++ ...obal-if-decl-no-else-eval-global-no-skip-try.js | 53 +++++++ ...ecl-no-else-eval-global-skip-early-err-block.js | 49 +++++++ ...cl-no-else-eval-global-skip-early-err-for-in.js | 48 ++++++ ...cl-no-else-eval-global-skip-early-err-for-of.js | 48 ++++++ ...-decl-no-else-eval-global-skip-early-err-for.js | 49 +++++++ ...cl-no-else-eval-global-skip-early-err-switch.js | 50 +++++++ ...-decl-no-else-eval-global-skip-early-err-try.js | 60 ++++++++ ...l-if-decl-no-else-eval-global-skip-early-err.js | 32 ++++ .../global-if-decl-no-else-eval-global-update.js | 38 +++++ ...-if-stmt-else-decl-eval-global-block-scoping.js | 55 +++++++ ...e-decl-eval-global-existing-block-fn-no-init.js | 33 +++++ ...se-decl-eval-global-existing-block-fn-update.js | 45 ++++++ ...mt-else-decl-eval-global-existing-fn-no-init.js | 31 ++++ ...tmt-else-decl-eval-global-existing-fn-update.js | 42 ++++++ ...t-else-decl-eval-global-existing-global-init.js | 52 +++++++ ...else-decl-eval-global-existing-global-update.js | 48 ++++++ ...l-global-existing-non-enumerable-global-init.js | 52 +++++++ ...t-else-decl-eval-global-existing-var-no-init.js | 30 ++++ ...mt-else-decl-eval-global-existing-var-update.js | 42 ++++++ .../global-if-stmt-else-decl-eval-global-init.js | 39 +++++ ...al-if-stmt-else-decl-eval-global-no-skip-try.js | 53 +++++++ ...t-else-decl-eval-global-skip-early-err-block.js | 49 +++++++ ...-else-decl-eval-global-skip-early-err-for-in.js | 48 ++++++ ...-else-decl-eval-global-skip-early-err-for-of.js | 48 ++++++ ...tmt-else-decl-eval-global-skip-early-err-for.js | 49 +++++++ ...-else-decl-eval-global-skip-early-err-switch.js | 50 +++++++ ...tmt-else-decl-eval-global-skip-early-err-try.js | 60 ++++++++ ...if-stmt-else-decl-eval-global-skip-early-err.js | 32 ++++ .../global-if-stmt-else-decl-eval-global-update.js | 38 +++++ ...global-switch-case-eval-global-block-scoping.js | 50 +++++++ ...h-case-eval-global-existing-block-fn-no-init.js | 28 ++++ ...ch-case-eval-global-existing-block-fn-update.js | 40 +++++ ...-switch-case-eval-global-existing-fn-no-init.js | 26 ++++ ...l-switch-case-eval-global-existing-fn-update.js | 37 +++++ ...switch-case-eval-global-existing-global-init.js | 47 ++++++ ...itch-case-eval-global-existing-global-update.js | 43 ++++++ ...l-global-existing-non-enumerable-global-init.js | 47 ++++++ ...switch-case-eval-global-existing-var-no-init.js | 25 ++++ ...-switch-case-eval-global-existing-var-update.js | 37 +++++ .../global-switch-case-eval-global-init.js | 34 +++++ .../global-switch-case-eval-global-no-skip-try.js | 48 ++++++ ...switch-case-eval-global-skip-early-err-block.js | 44 ++++++ ...witch-case-eval-global-skip-early-err-for-in.js | 43 ++++++ ...witch-case-eval-global-skip-early-err-for-of.js | 43 ++++++ ...l-switch-case-eval-global-skip-early-err-for.js | 44 ++++++ ...witch-case-eval-global-skip-early-err-switch.js | 45 ++++++ ...l-switch-case-eval-global-skip-early-err-try.js | 55 +++++++ ...lobal-switch-case-eval-global-skip-early-err.js | 27 ++++ .../global-switch-case-eval-global-update.js | 33 +++++ ...global-switch-dflt-eval-global-block-scoping.js | 50 +++++++ ...h-dflt-eval-global-existing-block-fn-no-init.js | 28 ++++ ...ch-dflt-eval-global-existing-block-fn-update.js | 40 +++++ ...-switch-dflt-eval-global-existing-fn-no-init.js | 26 ++++ ...l-switch-dflt-eval-global-existing-fn-update.js | 37 +++++ ...switch-dflt-eval-global-existing-global-init.js | 47 ++++++ ...itch-dflt-eval-global-existing-global-update.js | 43 ++++++ ...l-global-existing-non-enumerable-global-init.js | 47 ++++++ ...switch-dflt-eval-global-existing-var-no-init.js | 25 ++++ ...-switch-dflt-eval-global-existing-var-update.js | 37 +++++ .../global-switch-dflt-eval-global-init.js | 34 +++++ .../global-switch-dflt-eval-global-no-skip-try.js | 48 ++++++ ...switch-dflt-eval-global-skip-early-err-block.js | 44 ++++++ ...witch-dflt-eval-global-skip-early-err-for-in.js | 43 ++++++ ...witch-dflt-eval-global-skip-early-err-for-of.js | 43 ++++++ ...l-switch-dflt-eval-global-skip-early-err-for.js | 44 ++++++ ...witch-dflt-eval-global-skip-early-err-switch.js | 45 ++++++ ...l-switch-dflt-eval-global-skip-early-err-try.js | 55 +++++++ ...lobal-switch-dflt-eval-global-skip-early-err.js | 27 ++++ .../global-switch-dflt-eval-global-update.js | 33 +++++ .../annexB/language/eval-code/indirect/shell.js | 14 ++ .../test262/annexB/language/eval-code/shell.js | 0 .../language/expressions/assignment/browser.js | 0 .../dstr/array-pattern-emulates-undefined.js | 46 ++++++ .../expressions/assignment/dstr/browser.js | 0 .../dstr/object-pattern-emulates-undefined.js | 37 +++++ .../language/expressions/assignment/dstr/shell.js | 0 .../language/expressions/assignment/shell.js | 0 .../test262/annexB/language/expressions/browser.js | 0 .../language/expressions/coalesce/browser.js | 0 .../expressions/coalesce/emulates-undefined.js | 22 +++ .../annexB/language/expressions/coalesce/shell.js | 0 .../language/expressions/conditional/browser.js | 0 .../expressions/conditional/emulates-undefined.js | 27 ++++ .../language/expressions/conditional/shell.js | 0 .../expressions/does-not-equals/browser.js | 0 .../does-not-equals/emulates-undefined.js | 34 +++++ .../language/expressions/does-not-equals/shell.js | 0 .../annexB/language/expressions/equals/browser.js | 0 .../expressions/equals/emulates-undefined.js | 32 ++++ .../annexB/language/expressions/equals/shell.js | 0 .../language/expressions/logical-and/browser.js | 0 .../expressions/logical-and/emulates-undefined.js | 26 ++++ .../language/expressions/logical-and/shell.js | 0 .../expressions/logical-assignment/browser.js | 0 .../logical-assignment/emulates-undefined-and.js | 27 ++++ .../emulates-undefined-coalesce.js | 21 +++ .../logical-assignment/emulates-undefined-or.js | 28 ++++ .../expressions/logical-assignment/shell.js | 0 .../language/expressions/logical-not/browser.js | 0 .../expressions/logical-not/emulates-undefined.js | 27 ++++ .../language/expressions/logical-not/shell.js | 0 .../language/expressions/logical-or/browser.js | 0 .../expressions/logical-or/emulates-undefined.js | 26 ++++ .../language/expressions/logical-or/shell.js | 0 .../test262/annexB/language/expressions/shell.js | 0 .../expressions/strict-does-not-equals/browser.js | 0 .../strict-does-not-equals/emulates-undefined.js | 31 ++++ .../expressions/strict-does-not-equals/shell.js | 0 .../language/expressions/strict-equals/browser.js | 0 .../strict-equals/emulates-undefined.js | 29 ++++ .../language/expressions/strict-equals/shell.js | 0 .../expressions/template-literal/browser.js | 0 .../legacy-octal-escape-sequence-non-strict.js | 15 ++ .../legacy-octal-escape-sequence-strict-strict.js | 20 +++ .../language/expressions/template-literal/shell.js | 0 .../annexB/language/expressions/typeof/browser.js | 0 .../expressions/typeof/emulates-undefined.js | 29 ++++ .../annexB/language/expressions/typeof/shell.js | 0 .../annexB/language/expressions/yield/browser.js | 0 .../annexB/language/expressions/yield/shell.js | 0 ...return-emulates-undefined-throws-when-called.js | 33 +++++ ...-throw-emulates-undefined-throws-when-called.js | 50 +++++++ .../function-code/block-decl-func-block-scoping.js | 52 +++++++ .../block-decl-func-existing-block-fn-no-init.js | 33 +++++ .../block-decl-func-existing-block-fn-update.js | 42 ++++++ .../block-decl-func-existing-fn-no-init.js | 31 ++++ .../block-decl-func-existing-fn-update.js | 42 ++++++ .../block-decl-func-existing-var-no-init.js | 30 ++++ .../block-decl-func-existing-var-update.js | 41 ++++++ .../language/function-code/block-decl-func-init.js | 38 +++++ .../function-code/block-decl-func-no-skip-try.js | 51 +++++++ .../block-decl-func-skip-arguments.js | 59 ++++++++ .../block-decl-func-skip-dft-param.js | 32 ++++ .../block-decl-func-skip-early-err-block.js | 47 ++++++ .../block-decl-func-skip-early-err-for-in.js | 46 ++++++ .../block-decl-func-skip-early-err-for-of.js | 46 ++++++ .../block-decl-func-skip-early-err-for.js | 47 ++++++ .../block-decl-func-skip-early-err-switch.js | 48 ++++++ .../block-decl-func-skip-early-err-try.js | 58 ++++++++ .../block-decl-func-skip-early-err.js | 33 +++++ .../function-code/block-decl-func-skip-param.js | 32 ++++ .../function-code/block-decl-func-update.js | 38 +++++ .../block-decl-nested-blocks-with-fun-decl.js | 42 ++++++ .../language/function-code/block-decl-nostrict.js | 40 +++++ .../annexB/language/function-code/browser.js | 0 .../function-code/function-redeclaration-block.js | 20 +++ .../function-code/function-redeclaration-switch.js | 35 +++++ .../if-decl-else-decl-a-func-block-scoping.js | 59 ++++++++ ...l-else-decl-a-func-existing-block-fn-no-init.js | 40 +++++ ...cl-else-decl-a-func-existing-block-fn-update.js | 49 +++++++ ...if-decl-else-decl-a-func-existing-fn-no-init.js | 38 +++++ .../if-decl-else-decl-a-func-existing-fn-update.js | 49 +++++++ ...f-decl-else-decl-a-func-existing-var-no-init.js | 37 +++++ ...if-decl-else-decl-a-func-existing-var-update.js | 48 ++++++ .../function-code/if-decl-else-decl-a-func-init.js | 45 ++++++ .../if-decl-else-decl-a-func-no-skip-try.js | 58 ++++++++ .../if-decl-else-decl-a-func-skip-dft-param.js | 39 +++++ ...f-decl-else-decl-a-func-skip-early-err-block.js | 54 +++++++ ...-decl-else-decl-a-func-skip-early-err-for-in.js | 53 +++++++ ...-decl-else-decl-a-func-skip-early-err-for-of.js | 53 +++++++ .../if-decl-else-decl-a-func-skip-early-err-for.js | 54 +++++++ ...-decl-else-decl-a-func-skip-early-err-switch.js | 55 +++++++ .../if-decl-else-decl-a-func-skip-early-err-try.js | 65 +++++++++ .../if-decl-else-decl-a-func-skip-early-err.js | 40 +++++ .../if-decl-else-decl-a-func-skip-param.js | 39 +++++ .../if-decl-else-decl-a-func-update.js | 45 ++++++ .../if-decl-else-decl-b-func-block-scoping.js | 59 ++++++++ ...l-else-decl-b-func-existing-block-fn-no-init.js | 40 +++++ ...cl-else-decl-b-func-existing-block-fn-update.js | 49 +++++++ ...if-decl-else-decl-b-func-existing-fn-no-init.js | 38 +++++ .../if-decl-else-decl-b-func-existing-fn-update.js | 49 +++++++ ...f-decl-else-decl-b-func-existing-var-no-init.js | 37 +++++ ...if-decl-else-decl-b-func-existing-var-update.js | 48 ++++++ .../function-code/if-decl-else-decl-b-func-init.js | 45 ++++++ .../if-decl-else-decl-b-func-no-skip-try.js | 58 ++++++++ .../if-decl-else-decl-b-func-skip-dft-param.js | 39 +++++ ...f-decl-else-decl-b-func-skip-early-err-block.js | 54 +++++++ ...-decl-else-decl-b-func-skip-early-err-for-in.js | 53 +++++++ ...-decl-else-decl-b-func-skip-early-err-for-of.js | 53 +++++++ .../if-decl-else-decl-b-func-skip-early-err-for.js | 54 +++++++ ...-decl-else-decl-b-func-skip-early-err-switch.js | 55 +++++++ .../if-decl-else-decl-b-func-skip-early-err-try.js | 65 +++++++++ .../if-decl-else-decl-b-func-skip-early-err.js | 40 +++++ .../if-decl-else-decl-b-func-skip-param.js | 39 +++++ .../if-decl-else-decl-b-func-update.js | 45 ++++++ .../if-decl-else-stmt-func-block-scoping.js | 59 ++++++++ ...ecl-else-stmt-func-existing-block-fn-no-init.js | 40 +++++ ...decl-else-stmt-func-existing-block-fn-update.js | 49 +++++++ .../if-decl-else-stmt-func-existing-fn-no-init.js | 38 +++++ .../if-decl-else-stmt-func-existing-fn-update.js | 49 +++++++ .../if-decl-else-stmt-func-existing-var-no-init.js | 37 +++++ .../if-decl-else-stmt-func-existing-var-update.js | 48 ++++++ .../function-code/if-decl-else-stmt-func-init.js | 45 ++++++ .../if-decl-else-stmt-func-no-skip-try.js | 58 ++++++++ .../if-decl-else-stmt-func-skip-dft-param.js | 39 +++++ .../if-decl-else-stmt-func-skip-early-err-block.js | 54 +++++++ ...if-decl-else-stmt-func-skip-early-err-for-in.js | 53 +++++++ ...if-decl-else-stmt-func-skip-early-err-for-of.js | 53 +++++++ .../if-decl-else-stmt-func-skip-early-err-for.js | 54 +++++++ ...if-decl-else-stmt-func-skip-early-err-switch.js | 55 +++++++ .../if-decl-else-stmt-func-skip-early-err-try.js | 65 +++++++++ .../if-decl-else-stmt-func-skip-early-err.js | 40 +++++ .../if-decl-else-stmt-func-skip-param.js | 39 +++++ .../function-code/if-decl-else-stmt-func-update.js | 45 ++++++ .../if-decl-no-else-func-block-scoping.js | 59 ++++++++ ...-decl-no-else-func-existing-block-fn-no-init.js | 40 +++++ ...f-decl-no-else-func-existing-block-fn-update.js | 49 +++++++ .../if-decl-no-else-func-existing-fn-no-init.js | 38 +++++ .../if-decl-no-else-func-existing-fn-update.js | 49 +++++++ .../if-decl-no-else-func-existing-var-no-init.js | 37 +++++ .../if-decl-no-else-func-existing-var-update.js | 48 ++++++ .../function-code/if-decl-no-else-func-init.js | 45 ++++++ .../if-decl-no-else-func-no-skip-try.js | 58 ++++++++ .../if-decl-no-else-func-skip-dft-param.js | 39 +++++ .../if-decl-no-else-func-skip-early-err-block.js | 54 +++++++ .../if-decl-no-else-func-skip-early-err-for-in.js | 53 +++++++ .../if-decl-no-else-func-skip-early-err-for-of.js | 53 +++++++ .../if-decl-no-else-func-skip-early-err-for.js | 54 +++++++ .../if-decl-no-else-func-skip-early-err-switch.js | 55 +++++++ .../if-decl-no-else-func-skip-early-err-try.js | 65 +++++++++ .../if-decl-no-else-func-skip-early-err.js | 40 +++++ .../if-decl-no-else-func-skip-param.js | 39 +++++ .../function-code/if-decl-no-else-func-update.js | 45 ++++++ .../if-stmt-else-decl-func-block-scoping.js | 59 ++++++++ ...tmt-else-decl-func-existing-block-fn-no-init.js | 40 +++++ ...stmt-else-decl-func-existing-block-fn-update.js | 49 +++++++ .../if-stmt-else-decl-func-existing-fn-no-init.js | 38 +++++ .../if-stmt-else-decl-func-existing-fn-update.js | 49 +++++++ .../if-stmt-else-decl-func-existing-var-no-init.js | 37 +++++ .../if-stmt-else-decl-func-existing-var-update.js | 48 ++++++ .../function-code/if-stmt-else-decl-func-init.js | 45 ++++++ .../if-stmt-else-decl-func-no-skip-try.js | 58 ++++++++ .../if-stmt-else-decl-func-skip-dft-param.js | 39 +++++ .../if-stmt-else-decl-func-skip-early-err-block.js | 54 +++++++ ...if-stmt-else-decl-func-skip-early-err-for-in.js | 53 +++++++ ...if-stmt-else-decl-func-skip-early-err-for-of.js | 53 +++++++ .../if-stmt-else-decl-func-skip-early-err-for.js | 54 +++++++ ...if-stmt-else-decl-func-skip-early-err-switch.js | 55 +++++++ .../if-stmt-else-decl-func-skip-early-err-try.js | 65 +++++++++ .../if-stmt-else-decl-func-skip-early-err.js | 40 +++++ .../if-stmt-else-decl-func-skip-param.js | 39 +++++ .../function-code/if-stmt-else-decl-func-update.js | 45 ++++++ .../test262/annexB/language/function-code/shell.js | 0 .../function-code/switch-case-decl-nostrict.js | 41 ++++++ .../switch-case-func-block-scoping.js | 53 +++++++ .../switch-case-func-existing-block-fn-no-init.js | 34 +++++ .../switch-case-func-existing-block-fn-update.js | 43 ++++++ .../switch-case-func-existing-fn-no-init.js | 32 ++++ .../switch-case-func-existing-fn-update.js | 43 ++++++ .../switch-case-func-existing-var-no-init.js | 31 ++++ .../switch-case-func-existing-var-update.js | 42 ++++++ .../function-code/switch-case-func-init.js | 39 +++++ .../function-code/switch-case-func-no-skip-try.js | 52 +++++++ .../switch-case-func-skip-dft-param.js | 33 +++++ .../switch-case-func-skip-early-err-block.js | 48 ++++++ .../switch-case-func-skip-early-err-for-in.js | 47 ++++++ .../switch-case-func-skip-early-err-for-of.js | 47 ++++++ .../switch-case-func-skip-early-err-for.js | 48 ++++++ .../switch-case-func-skip-early-err-switch.js | 49 +++++++ .../switch-case-func-skip-early-err-try.js | 59 ++++++++ .../switch-case-func-skip-early-err.js | 34 +++++ .../function-code/switch-case-func-skip-param.js | 33 +++++ .../function-code/switch-case-func-update.js | 39 +++++ .../function-code/switch-dflt-decl-nostrict.js | 41 ++++++ .../switch-dflt-func-block-scoping.js | 53 +++++++ .../switch-dflt-func-existing-block-fn-no-init.js | 34 +++++ .../switch-dflt-func-existing-block-fn-update.js | 43 ++++++ .../switch-dflt-func-existing-fn-no-init.js | 32 ++++ .../switch-dflt-func-existing-fn-update.js | 43 ++++++ .../switch-dflt-func-existing-var-no-init.js | 31 ++++ .../switch-dflt-func-existing-var-update.js | 42 ++++++ .../function-code/switch-dflt-func-init.js | 39 +++++ .../function-code/switch-dflt-func-no-skip-try.js | 52 +++++++ .../switch-dflt-func-skip-dft-param.js | 33 +++++ .../switch-dflt-func-skip-early-err-block.js | 48 ++++++ .../switch-dflt-func-skip-early-err-for-in.js | 47 ++++++ .../switch-dflt-func-skip-early-err-for-of.js | 47 ++++++ .../switch-dflt-func-skip-early-err-for.js | 48 ++++++ .../switch-dflt-func-skip-early-err-switch.js | 49 +++++++ .../switch-dflt-func-skip-early-err-try.js | 59 ++++++++ .../switch-dflt-func-skip-early-err.js | 34 +++++ .../function-code/switch-dflt-func-skip-param.js | 33 +++++ .../function-code/switch-dflt-func-update.js | 39 +++++ .../global-code/block-decl-global-block-scoping.js | 46 ++++++ .../block-decl-global-existing-block-fn-no-init.js | 26 ++++ .../block-decl-global-existing-block-fn-update.js | 36 +++++ .../block-decl-global-existing-fn-no-init.js | 25 ++++ .../block-decl-global-existing-fn-update.js | 35 +++++ .../block-decl-global-existing-global-init.js | 50 +++++++ ...l-global-existing-non-enumerable-global-init.js | 51 +++++++ .../block-decl-global-existing-var-no-init.js | 24 +++ .../block-decl-global-existing-var-update.js | 33 +++++ .../language/global-code/block-decl-global-init.js | 32 ++++ .../global-code/block-decl-global-no-skip-try.js | 47 ++++++ .../block-decl-global-skip-early-err-block.js | 44 ++++++ .../block-decl-global-skip-early-err-for-in.js | 43 ++++++ .../block-decl-global-skip-early-err-for-of.js | 43 ++++++ .../block-decl-global-skip-early-err-for.js | 44 ++++++ .../block-decl-global-skip-early-err-switch.js | 45 ++++++ .../block-decl-global-skip-early-err-try.js | 54 +++++++ .../block-decl-global-skip-early-err.js | 26 ++++ .../global-code/block-decl-global-update.js | 31 ++++ .../test262/annexB/language/global-code/browser.js | 0 .../if-decl-else-decl-a-global-block-scoping.js | 53 +++++++ ...else-decl-a-global-existing-block-fn-no-init.js | 33 +++++ ...-else-decl-a-global-existing-block-fn-update.js | 43 ++++++ ...-decl-else-decl-a-global-existing-fn-no-init.js | 32 ++++ ...f-decl-else-decl-a-global-existing-fn-update.js | 42 ++++++ ...decl-else-decl-a-global-existing-global-init.js | 57 ++++++++ ...a-global-existing-non-enumerable-global-init.js | 58 ++++++++ ...decl-else-decl-a-global-existing-var-no-init.js | 31 ++++ ...-decl-else-decl-a-global-existing-var-update.js | 40 +++++ .../global-code/if-decl-else-decl-a-global-init.js | 39 +++++ .../if-decl-else-decl-a-global-no-skip-try.js | 54 +++++++ ...decl-else-decl-a-global-skip-early-err-block.js | 51 +++++++ ...ecl-else-decl-a-global-skip-early-err-for-in.js | 50 +++++++ ...ecl-else-decl-a-global-skip-early-err-for-of.js | 50 +++++++ ...f-decl-else-decl-a-global-skip-early-err-for.js | 51 +++++++ ...ecl-else-decl-a-global-skip-early-err-switch.js | 52 +++++++ ...f-decl-else-decl-a-global-skip-early-err-try.js | 61 ++++++++ .../if-decl-else-decl-a-global-skip-early-err.js | 33 +++++ .../if-decl-else-decl-a-global-update.js | 38 +++++ .../if-decl-else-decl-b-global-block-scoping.js | 53 +++++++ ...else-decl-b-global-existing-block-fn-no-init.js | 33 +++++ ...-else-decl-b-global-existing-block-fn-update.js | 43 ++++++ ...-decl-else-decl-b-global-existing-fn-no-init.js | 32 ++++ ...f-decl-else-decl-b-global-existing-fn-update.js | 42 ++++++ ...decl-else-decl-b-global-existing-global-init.js | 57 ++++++++ ...b-global-existing-non-enumerable-global-init.js | 58 ++++++++ ...decl-else-decl-b-global-existing-var-no-init.js | 31 ++++ ...-decl-else-decl-b-global-existing-var-update.js | 40 +++++ .../global-code/if-decl-else-decl-b-global-init.js | 39 +++++ .../if-decl-else-decl-b-global-no-skip-try.js | 54 +++++++ ...decl-else-decl-b-global-skip-early-err-block.js | 51 +++++++ ...ecl-else-decl-b-global-skip-early-err-for-in.js | 50 +++++++ ...ecl-else-decl-b-global-skip-early-err-for-of.js | 50 +++++++ ...f-decl-else-decl-b-global-skip-early-err-for.js | 51 +++++++ ...ecl-else-decl-b-global-skip-early-err-switch.js | 52 +++++++ ...f-decl-else-decl-b-global-skip-early-err-try.js | 61 ++++++++ .../if-decl-else-decl-b-global-skip-early-err.js | 33 +++++ .../if-decl-else-decl-b-global-update.js | 38 +++++ .../if-decl-else-stmt-global-block-scoping.js | 53 +++++++ ...l-else-stmt-global-existing-block-fn-no-init.js | 33 +++++ ...cl-else-stmt-global-existing-block-fn-update.js | 43 ++++++ ...if-decl-else-stmt-global-existing-fn-no-init.js | 32 ++++ .../if-decl-else-stmt-global-existing-fn-update.js | 42 ++++++ ...f-decl-else-stmt-global-existing-global-init.js | 57 ++++++++ ...t-global-existing-non-enumerable-global-init.js | 58 ++++++++ ...f-decl-else-stmt-global-existing-var-no-init.js | 31 ++++ ...if-decl-else-stmt-global-existing-var-update.js | 40 +++++ .../global-code/if-decl-else-stmt-global-init.js | 39 +++++ .../if-decl-else-stmt-global-no-skip-try.js | 54 +++++++ ...f-decl-else-stmt-global-skip-early-err-block.js | 51 +++++++ ...-decl-else-stmt-global-skip-early-err-for-in.js | 50 +++++++ ...-decl-else-stmt-global-skip-early-err-for-of.js | 50 +++++++ .../if-decl-else-stmt-global-skip-early-err-for.js | 51 +++++++ ...-decl-else-stmt-global-skip-early-err-switch.js | 52 +++++++ .../if-decl-else-stmt-global-skip-early-err-try.js | 61 ++++++++ .../if-decl-else-stmt-global-skip-early-err.js | 33 +++++ .../global-code/if-decl-else-stmt-global-update.js | 38 +++++ .../if-decl-no-else-global-block-scoping.js | 53 +++++++ ...ecl-no-else-global-existing-block-fn-no-init.js | 33 +++++ ...decl-no-else-global-existing-block-fn-update.js | 43 ++++++ .../if-decl-no-else-global-existing-fn-no-init.js | 32 ++++ .../if-decl-no-else-global-existing-fn-update.js | 42 ++++++ .../if-decl-no-else-global-existing-global-init.js | 57 ++++++++ ...e-global-existing-non-enumerable-global-init.js | 58 ++++++++ .../if-decl-no-else-global-existing-var-no-init.js | 31 ++++ .../if-decl-no-else-global-existing-var-update.js | 40 +++++ .../global-code/if-decl-no-else-global-init.js | 39 +++++ .../if-decl-no-else-global-no-skip-try.js | 54 +++++++ .../if-decl-no-else-global-skip-early-err-block.js | 51 +++++++ ...if-decl-no-else-global-skip-early-err-for-in.js | 50 +++++++ ...if-decl-no-else-global-skip-early-err-for-of.js | 50 +++++++ .../if-decl-no-else-global-skip-early-err-for.js | 51 +++++++ ...if-decl-no-else-global-skip-early-err-switch.js | 52 +++++++ .../if-decl-no-else-global-skip-early-err-try.js | 61 ++++++++ .../if-decl-no-else-global-skip-early-err.js | 33 +++++ .../global-code/if-decl-no-else-global-update.js | 38 +++++ .../if-stmt-else-decl-global-block-scoping.js | 53 +++++++ ...t-else-decl-global-existing-block-fn-no-init.js | 33 +++++ ...mt-else-decl-global-existing-block-fn-update.js | 43 ++++++ ...if-stmt-else-decl-global-existing-fn-no-init.js | 32 ++++ .../if-stmt-else-decl-global-existing-fn-update.js | 42 ++++++ ...f-stmt-else-decl-global-existing-global-init.js | 57 ++++++++ ...l-global-existing-non-enumerable-global-init.js | 58 ++++++++ ...f-stmt-else-decl-global-existing-var-no-init.js | 31 ++++ ...if-stmt-else-decl-global-existing-var-update.js | 40 +++++ .../global-code/if-stmt-else-decl-global-init.js | 39 +++++ .../if-stmt-else-decl-global-no-skip-try.js | 54 +++++++ ...f-stmt-else-decl-global-skip-early-err-block.js | 51 +++++++ ...-stmt-else-decl-global-skip-early-err-for-in.js | 50 +++++++ ...-stmt-else-decl-global-skip-early-err-for-of.js | 50 +++++++ .../if-stmt-else-decl-global-skip-early-err-for.js | 51 +++++++ ...-stmt-else-decl-global-skip-early-err-switch.js | 52 +++++++ .../if-stmt-else-decl-global-skip-early-err-try.js | 61 ++++++++ .../if-stmt-else-decl-global-skip-early-err.js | 33 +++++ .../global-code/if-stmt-else-decl-global-update.js | 38 +++++ .../global-code/script-decl-lex-collision.js | 25 ++++ .../test262/annexB/language/global-code/shell.js | 14 ++ .../switch-case-global-block-scoping.js | 47 ++++++ ...switch-case-global-existing-block-fn-no-init.js | 27 ++++ .../switch-case-global-existing-block-fn-update.js | 37 +++++ .../switch-case-global-existing-fn-no-init.js | 26 ++++ .../switch-case-global-existing-fn-update.js | 36 +++++ .../switch-case-global-existing-global-init.js | 51 +++++++ ...e-global-existing-non-enumerable-global-init.js | 52 +++++++ .../switch-case-global-existing-var-no-init.js | 25 ++++ .../switch-case-global-existing-var-update.js | 34 +++++ .../global-code/switch-case-global-init.js | 33 +++++ .../global-code/switch-case-global-no-skip-try.js | 48 ++++++ .../switch-case-global-skip-early-err-block.js | 45 ++++++ .../switch-case-global-skip-early-err-for-in.js | 44 ++++++ .../switch-case-global-skip-early-err-for-of.js | 44 ++++++ .../switch-case-global-skip-early-err-for.js | 45 ++++++ .../switch-case-global-skip-early-err-switch.js | 46 ++++++ .../switch-case-global-skip-early-err-try.js | 55 +++++++ .../switch-case-global-skip-early-err.js | 27 ++++ .../global-code/switch-case-global-update.js | 32 ++++ .../switch-dflt-global-block-scoping.js | 47 ++++++ ...switch-dflt-global-existing-block-fn-no-init.js | 27 ++++ .../switch-dflt-global-existing-block-fn-update.js | 37 +++++ .../switch-dflt-global-existing-fn-no-init.js | 26 ++++ .../switch-dflt-global-existing-fn-update.js | 36 +++++ .../switch-dflt-global-existing-global-init.js | 51 +++++++ ...t-global-existing-non-enumerable-global-init.js | 52 +++++++ .../switch-dflt-global-existing-var-no-init.js | 25 ++++ .../switch-dflt-global-existing-var-update.js | 34 +++++ .../global-code/switch-dflt-global-init.js | 33 +++++ .../global-code/switch-dflt-global-no-skip-try.js | 48 ++++++ .../switch-dflt-global-skip-early-err-block.js | 45 ++++++ .../switch-dflt-global-skip-early-err-for-in.js | 44 ++++++ .../switch-dflt-global-skip-early-err-for-of.js | 44 ++++++ .../switch-dflt-global-skip-early-err-for.js | 45 ++++++ .../switch-dflt-global-skip-early-err-switch.js | 46 ++++++ .../switch-dflt-global-skip-early-err-try.js | 55 +++++++ .../switch-dflt-global-skip-early-err.js | 27 ++++ .../global-code/switch-dflt-global-update.js | 32 ++++ .../test262/annexB/language/literals/browser.js | 0 .../annexB/language/literals/regexp/browser.js | 0 .../language/literals/regexp/class-escape.js | 72 +++++++++ .../literals/regexp/extended-pattern-char.js | 32 ++++ .../language/literals/regexp/identity-escape.js | 48 ++++++ .../literals/regexp/legacy-octal-escape.js | 72 +++++++++ .../regexp/non-empty-class-ranges-no-dash.js | 49 +++++++ .../literals/regexp/non-empty-class-ranges.js | 36 +++++ .../regexp/quantifiable-assertion-followed-by.js | 70 +++++++++ .../quantifiable-assertion-not-followed-by.js | 70 +++++++++ .../annexB/language/literals/regexp/shell.js | 0 .../test262/annexB/language/literals/shell.js | 0 js/src/tests/test262/annexB/language/shell.js | 0 .../test262/annexB/language/statements/browser.js | 0 .../annexB/language/statements/class/browser.js | 0 .../annexB/language/statements/class/shell.js | 0 .../language/statements/class/subclass/browser.js | 0 .../language/statements/class/subclass/shell.js | 0 .../subclass/superclass-emulates-undefined.js | 35 +++++ .../superclass-prototype-emulates-undefined.js | 31 ++++ .../annexB/language/statements/const/browser.js | 0 .../const/dstr/array-pattern-emulates-undefined.js | 39 +++++ .../language/statements/const/dstr/browser.js | 0 .../dstr/object-pattern-emulates-undefined.js | 37 +++++ .../annexB/language/statements/const/dstr/shell.js | 0 .../annexB/language/statements/const/shell.js | 0 .../language/statements/for-await-of/browser.js | 0 ...return-emulates-undefined-throws-when-called.js | 40 +++++ .../language/statements/for-await-of/shell.js | 0 .../language/statements/for-in/bare-initializer.js | 16 ++ .../annexB/language/statements/for-in/browser.js | 0 .../statements/for-in/const-initializer.js | 16 ++ .../language/statements/for-in/let-initializer.js | 16 ++ .../statements/for-in/nonstrict-initializer.js | 41 ++++++ .../annexB/language/statements/for-in/shell.js | 0 .../statements/for-in/strict-initializer-strict.js | 17 +++ .../for-in/var-arraybindingpattern-initializer.js | 15 ++ .../for-in/var-objectbindingpattern-initializer.js | 16 ++ .../annexB/language/statements/for-of/browser.js | 0 ...return-emulates-undefined-throws-when-called.js | 27 ++++ .../annexB/language/statements/for-of/shell.js | 0 .../annexB/language/statements/function/browser.js | 0 .../default-parameters-emulates-undefined.js | 74 ++++++++++ .../annexB/language/statements/function/shell.js | 0 .../annexB/language/statements/if/browser.js | 0 .../language/statements/if/emulated-undefined.js | 33 +++++ .../test262/annexB/language/statements/if/shell.js | 0 .../annexB/language/statements/labeled/browser.js | 0 .../statements/labeled/function-declaration.js | 14 ++ .../annexB/language/statements/labeled/shell.js | 0 .../test262/annexB/language/statements/shell.js | 0 .../annexB/language/statements/switch/browser.js | 0 .../statements/switch/emulates-undefined.js | 33 +++++ .../annexB/language/statements/switch/shell.js | 0 .../annexB/language/statements/try/browser.js | 0 .../statements/try/catch-redeclared-for-in-var.js | 29 ++++ .../statements/try/catch-redeclared-for-of-var.js | 29 ++++ .../statements/try/catch-redeclared-for-var.js | 29 ++++ .../try/catch-redeclared-var-statement-captured.js | 23 +++ .../try/catch-redeclared-var-statement.js | 22 +++ .../annexB/language/statements/try/shell.js | 0 js/src/tests/test262/annexB/shell.js | 0 1257 files changed, 44461 insertions(+) create mode 100644 js/src/tests/test262/annexB/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Array/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Array/from/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Array/from/iterator-method-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/Array/from/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/Array/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/B.2.4.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/nan.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/return-value.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/this-not-date.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/B.2.5.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-not-date.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-time-nan.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-time-valid.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/time-clip.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-nan.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-number-absolute.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-number-relative.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-to-number-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/value.js create mode 100644 js/src/tests/test262/annexB/built-ins/Date/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/Function/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-close-comment-body.js create mode 100644 js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-close-comment-params.js create mode 100644 js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-open-comment-body.js create mode 100644 js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-open-comment-params.js create mode 100644 js/src/tests/test262/annexB/built-ins/Function/createdynfn-no-line-terminator-html-close-comment-body.js create mode 100644 js/src/tests/test262/annexB/built-ins/Function/createdynfn-no-line-terminator-html-close-comment-params.js create mode 100644 js/src/tests/test262/annexB/built-ins/Function/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/Object/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Object/is/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/Object/is/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/Object/is/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/Object/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/RegExp-control-escape-russian-letter.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/RegExp-decimal-escape-class-range.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/RegExp-decimal-escape-not-capturing.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class-range.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/RegExp-leading-escape-BMP.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/RegExp-leading-escape.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/RegExp-trailing-escape-BMP.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/RegExp-trailing-escape.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/incomplete_hex_unicode_escape.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-cross-realm-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-not-regexp-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-subclass-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-cross-realm-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-not-regexp-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-subclass-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-cross-realm-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-not-regexp-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-subclass-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-cross-realm-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-not-regexp-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-subclass-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-cross-realm-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-not-regexp-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-subclass-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-cross-realm-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-not-regexp-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-subclass-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/named-groups/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed-lookbehind.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/named-groups/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/Symbol.match-getter-recompiles-source.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/toint32-limit-recompiles-source.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/B.RegExp.prototype.compile.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/duplicate-named-capturing-groups-syntax.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-string-invalid.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-to-string-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-to-string.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-distinct.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-flags-defined.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-immutable-lastindex.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-props.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-same.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-invalid-u.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-invalid.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-u.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-to-string-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-cross-realm-instance.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-not-object.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-obj-not-regexp.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-subclass-instance.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/flags/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/flags/order-after-compile.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/flags/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/prototype/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/RegExp/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/anchor/B.2.3.2.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/anchor/attr-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/anchor/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/anchor/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/anchor/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/anchor/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/anchor/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/anchor/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/anchor/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/big/B.2.3.3.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/big/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/big/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/big/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/big/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/big/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/big/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/big/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/blink/B.2.3.4.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/blink/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/blink/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/blink/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/blink/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/blink/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/blink/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/blink/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/bold/B.2.3.5.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/bold/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/bold/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/bold/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/bold/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/bold/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/bold/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/bold/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fixed/B.2.3.6.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fixed/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fixed/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fixed/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fixed/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fixed/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fixed/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fixed/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/B.2.3.7.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/attr-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/B.2.3.8.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/attr-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/italics/B.2.3.9.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/italics/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/italics/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/italics/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/italics/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/italics/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/italics/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/italics/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/link/B.2.3.10.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/link/attr-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/link/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/link/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/link/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/link/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/link/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/link/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/link/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/match/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/match/custom-matcher-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/match/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/matchAll/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/matchAll/custom-matcher-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/matchAll/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/replace/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/replace/custom-replacer-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/replace/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/replaceAll/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/replaceAll/custom-replacer-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/replaceAll/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/search/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/search/custom-searcher-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/search/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/small/B.2.3.11.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/small/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/small/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/small/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/small/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/small/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/small/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/small/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/split/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/split/custom-splitter-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/split/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/strike/B.2.3.12.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/strike/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/strike/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/strike/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/strike/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/strike/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/strike/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/strike/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sub/B.2.3.13.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sub/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sub/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sub/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sub/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sub/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sub/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sub/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/B.2.3.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-falsey.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-negative.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-positive.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-to-int-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-undef.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-and-length-as-numbers.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-negative.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-to-int-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/surrogate-pairs.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/this-non-obj-coerce.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/substr/this-to-str-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sup/B.2.3.14.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sup/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sup/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sup/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sup/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sup/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sup/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/sup/this-val-tostring-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/reference-trimStart.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/reference-trimEnd.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/String/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/iterator-method-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/argument_bigint.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/argument_types.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/empty-string.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/escape-above-astral.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/escape-above.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/escape-below.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/to-primitive-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/to-primitive-observe.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/to-string-err-symbol.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/to-string-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/to-string-observe.js create mode 100644 js/src/tests/test262/annexB/built-ins/escape/unmodified.js create mode 100644 js/src/tests/test262/annexB/built-ins/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/argument_bigint.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/argument_types.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/browser.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/empty-string.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/four-ignore-bad-u.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/four-ignore-end-str.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/four-ignore-non-hex.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/four.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/length.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/name.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/not-a-constructor.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/prop-desc.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/shell.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/to-primitive-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/to-primitive-observe.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/to-string-err-symbol.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/to-string-err.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/to-string-observe.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/two-ignore-end-str.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/two-ignore-non-hex.js create mode 100644 js/src/tests/test262/annexB/built-ins/unescape/two.js create mode 100644 js/src/tests/test262/annexB/language/browser.js create mode 100644 js/src/tests/test262/annexB/language/comments/browser.js create mode 100644 js/src/tests/test262/annexB/language/comments/multi-line-html-close.js create mode 100644 js/src/tests/test262/annexB/language/comments/shell.js create mode 100644 js/src/tests/test262/annexB/language/comments/single-line-html-close-asi.js create mode 100644 js/src/tests/test262/annexB/language/comments/single-line-html-close-unicode-separators.js create mode 100644 js/src/tests/test262/annexB/language/comments/single-line-html-close.js create mode 100644 js/src/tests/test262/annexB/language/comments/single-line-html-open.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/browser.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/block-decl-nostrict.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/browser.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-no-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-block-decl-eval-func-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-no-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-a-eval-func-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-no-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-decl-b-eval-func-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-no-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-else-stmt-eval-func-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-no-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-decl-no-else-eval-func-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-no-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-if-stmt-else-decl-eval-func-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-no-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-case-eval-func-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-no-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/func-switch-dflt-eval-func-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-block-decl-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-a-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-decl-b-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-else-stmt-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-decl-no-else-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-if-stmt-else-decl-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-case-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/global-switch-dflt-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-collision-in-sloppy-mode.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/script-decl-lex-no-collision-in-strict-mode-strict.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/shell.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/switch-case-decl-nostrict.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/switch-dflt-decl-nostrict.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/direct/var-env-lower-lex-catch-non-strict.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/browser.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-block-decl-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-a-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-decl-b-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-else-stmt-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-decl-no-else-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-if-stmt-else-decl-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-case-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-existing-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-init.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/global-switch-dflt-eval-global-update.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/indirect/shell.js create mode 100644 js/src/tests/test262/annexB/language/eval-code/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/assignment/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/assignment/dstr/array-pattern-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/assignment/dstr/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/assignment/dstr/object-pattern-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/assignment/dstr/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/assignment/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/coalesce/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/coalesce/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/coalesce/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/conditional/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/conditional/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/conditional/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/does-not-equals/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/does-not-equals/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/does-not-equals/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/equals/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/equals/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/equals/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-and/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-and/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-and/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-assignment/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-assignment/emulates-undefined-and.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-assignment/emulates-undefined-coalesce.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-assignment/emulates-undefined-or.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-assignment/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-not/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-not/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-not/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-or/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-or/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/logical-or/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/strict-does-not-equals/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/strict-does-not-equals/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/strict-does-not-equals/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/strict-equals/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/strict-equals/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/strict-equals/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/template-literal/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/template-literal/legacy-octal-escape-sequence-non-strict.js create mode 100644 js/src/tests/test262/annexB/language/expressions/template-literal/legacy-octal-escape-sequence-strict-strict.js create mode 100644 js/src/tests/test262/annexB/language/expressions/template-literal/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/typeof/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/typeof/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/expressions/typeof/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/yield/browser.js create mode 100644 js/src/tests/test262/annexB/language/expressions/yield/shell.js create mode 100644 js/src/tests/test262/annexB/language/expressions/yield/star-iterable-return-emulates-undefined-throws-when-called.js create mode 100644 js/src/tests/test262/annexB/language/expressions/yield/star-iterable-throw-emulates-undefined-throws-when-called.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-skip-arguments.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-skip-dft-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-func-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-nested-blocks-with-fun-decl.js create mode 100644 js/src/tests/test262/annexB/language/function-code/block-decl-nostrict.js create mode 100644 js/src/tests/test262/annexB/language/function-code/browser.js create mode 100644 js/src/tests/test262/annexB/language/function-code/function-redeclaration-block.js create mode 100644 js/src/tests/test262/annexB/language/function-code/function-redeclaration-switch.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-skip-dft-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-a-func-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-skip-dft-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-decl-b-func-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-skip-dft-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-else-stmt-func-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-skip-dft-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-decl-no-else-func-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-skip-dft-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/if-stmt-else-decl-func-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/shell.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-decl-nostrict.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-skip-dft-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-case-func-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-decl-nostrict.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-init.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-skip-dft-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-skip-param.js create mode 100644 js/src/tests/test262/annexB/language/function-code/switch-dflt-func-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/global-code/block-decl-global-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/browser.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-a-global-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-decl-b-global-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-else-stmt-global-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-decl-no-else-global-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/global-code/if-stmt-else-decl-global-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/script-decl-lex-collision.js create mode 100644 js/src/tests/test262/annexB/language/global-code/shell.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-case-global-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-block-scoping.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-existing-block-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-existing-block-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-existing-fn-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-existing-fn-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-existing-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-existing-non-enumerable-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-existing-var-no-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-existing-var-update.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-init.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-no-skip-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-skip-early-err-block.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-skip-early-err-for-in.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-skip-early-err-for-of.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-skip-early-err-for.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-skip-early-err-switch.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-skip-early-err-try.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-skip-early-err.js create mode 100644 js/src/tests/test262/annexB/language/global-code/switch-dflt-global-update.js create mode 100644 js/src/tests/test262/annexB/language/literals/browser.js create mode 100644 js/src/tests/test262/annexB/language/literals/regexp/browser.js create mode 100644 js/src/tests/test262/annexB/language/literals/regexp/class-escape.js create mode 100644 js/src/tests/test262/annexB/language/literals/regexp/extended-pattern-char.js create mode 100644 js/src/tests/test262/annexB/language/literals/regexp/identity-escape.js create mode 100644 js/src/tests/test262/annexB/language/literals/regexp/legacy-octal-escape.js create mode 100644 js/src/tests/test262/annexB/language/literals/regexp/non-empty-class-ranges-no-dash.js create mode 100644 js/src/tests/test262/annexB/language/literals/regexp/non-empty-class-ranges.js create mode 100644 js/src/tests/test262/annexB/language/literals/regexp/quantifiable-assertion-followed-by.js create mode 100644 js/src/tests/test262/annexB/language/literals/regexp/quantifiable-assertion-not-followed-by.js create mode 100644 js/src/tests/test262/annexB/language/literals/regexp/shell.js create mode 100644 js/src/tests/test262/annexB/language/literals/shell.js create mode 100644 js/src/tests/test262/annexB/language/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/class/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/class/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/class/subclass/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/class/subclass/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/class/subclass/superclass-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/statements/class/subclass/superclass-prototype-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/statements/const/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/const/dstr/array-pattern-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/statements/const/dstr/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/const/dstr/object-pattern-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/statements/const/dstr/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/const/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-await-of/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-await-of/iterator-close-return-emulates-undefined-throws-when-called.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-await-of/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-in/bare-initializer.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-in/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-in/const-initializer.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-in/let-initializer.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-in/nonstrict-initializer.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-in/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-in/strict-initializer-strict.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-in/var-arraybindingpattern-initializer.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-in/var-objectbindingpattern-initializer.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-of/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-of/iterator-close-return-emulates-undefined-throws-when-called.js create mode 100644 js/src/tests/test262/annexB/language/statements/for-of/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/function/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/function/default-parameters-emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/statements/function/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/if/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/if/emulated-undefined.js create mode 100644 js/src/tests/test262/annexB/language/statements/if/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/labeled/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/labeled/function-declaration.js create mode 100644 js/src/tests/test262/annexB/language/statements/labeled/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/switch/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/switch/emulates-undefined.js create mode 100644 js/src/tests/test262/annexB/language/statements/switch/shell.js create mode 100644 js/src/tests/test262/annexB/language/statements/try/browser.js create mode 100644 js/src/tests/test262/annexB/language/statements/try/catch-redeclared-for-in-var.js create mode 100644 js/src/tests/test262/annexB/language/statements/try/catch-redeclared-for-of-var.js create mode 100644 js/src/tests/test262/annexB/language/statements/try/catch-redeclared-for-var.js create mode 100644 js/src/tests/test262/annexB/language/statements/try/catch-redeclared-var-statement-captured.js create mode 100644 js/src/tests/test262/annexB/language/statements/try/catch-redeclared-var-statement.js create mode 100644 js/src/tests/test262/annexB/language/statements/try/shell.js create mode 100644 js/src/tests/test262/annexB/shell.js (limited to 'js/src/tests/test262/annexB') diff --git a/js/src/tests/test262/annexB/browser.js b/js/src/tests/test262/annexB/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Array/browser.js b/js/src/tests/test262/annexB/built-ins/Array/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Array/from/browser.js b/js/src/tests/test262/annexB/built-ins/Array/from/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Array/from/iterator-method-emulates-undefined.js b/js/src/tests/test262/annexB/built-ins/Array/from/iterator-method-emulates-undefined.js new file mode 100644 index 0000000000..5ee69df755 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Array/from/iterator-method-emulates-undefined.js @@ -0,0 +1,31 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-array.from +description: > + [[IsHTMLDDA]] object as @@iterator method gets called. +info: | + Array.from ( items [ , mapfn [ , thisArg ] ] ) + + [...] + 4. Let usingIterator be ? GetMethod(items, @@iterator). + 5. If usingIterator is not undefined, then + [...] + c. Let iteratorRecord be ? GetIterator(items, sync, usingIterator). + + GetIterator ( obj [ , hint [ , method ] ] ) + + [...] + 4. Let iterator be ? Call(method, obj). + 5. If Type(iterator) is not Object, throw a TypeError exception. +features: [Symbol.iterator, IsHTMLDDA] +---*/ + +var items = {}; +items[Symbol.iterator] = $262.IsHTMLDDA; + +assert.throws(TypeError, function() { + Array.from(items); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Array/from/shell.js b/js/src/tests/test262/annexB/built-ins/Array/from/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Array/shell.js b/js/src/tests/test262/annexB/built-ins/Array/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Date/browser.js b/js/src/tests/test262/annexB/built-ins/Date/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/browser.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/B.2.4.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/B.2.4.js new file mode 100644 index 0000000000..4e6091dd06 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/B.2.4.js @@ -0,0 +1,18 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: B.2.4 +description: > + Object.getOwnPropertyDescriptor returns data desc for functions on + built-ins (Date.prototype.getYear) +includes: [propertyHelper.js] +---*/ + +verifyProperty(Date.prototype, "getYear", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/browser.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/length.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/length.js new file mode 100644 index 0000000000..72bb65b0e7 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.4.1 +description: > + Date.prototype.getYear.length is 0. +info: | + Date.prototype.getYear ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(Date.prototype.getYear, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 0 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/name.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/name.js new file mode 100644 index 0000000000..6a3db43a9f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.4.1 +description: > + Date.prototype.getYear.name is "getYear". +info: | + Date.prototype.getYear ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(Date.prototype.getYear, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "getYear" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/nan.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/nan.js new file mode 100644 index 0000000000..121c54fcd5 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/nan.js @@ -0,0 +1,17 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.getyear +es6id: B.2.4.1 +es5id: B.2.4 +description: NaN time value +info: | + 1. Let t be ? thisTimeValue(this value). + 2. If t is NaN, return NaN. +---*/ + +var date = new Date({}); + +assert.sameValue(date.getYear(), NaN); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js new file mode 100644 index 0000000000..a3936a335e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.getYear does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.getYear), + false, + 'isConstructor(Date.prototype.getYear) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.getYear(); +}, '`let date = new Date(Date.now()); new date.getYear()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/return-value.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/return-value.js new file mode 100644 index 0000000000..1df44ae303 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/return-value.js @@ -0,0 +1,43 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.getyear +es6id: B.2.4.1 +es5id: B.2.4 +description: > + Return value for objects with numeric value in [[DateValue]] internal slot +info: | + 1. Let t be ? thisTimeValue(this value). + 2. If t is NaN, return NaN. + 3. Return YearFromTime(LocalTime(t)) - 1900. +---*/ + +assert.sameValue(new Date(1899, 0).getYear(), -1, '1899: first millisecond'); +assert.sameValue( + new Date(1899, 11, 31, 23, 59, 59, 999).getYear(), + -1, + '1899: final millisecond' +); + +assert.sameValue(new Date(1900, 0).getYear(), 0, '1900: first millisecond'); +assert.sameValue( + new Date(1900, 11, 31, 23, 59, 59, 999).getYear(), + 0, + '1900: final millisecond' +); + +assert.sameValue(new Date(1970, 0).getYear(), 70, '1970: first millisecond'); +assert.sameValue( + new Date(1970, 11, 31, 23, 59, 59, 999).getYear(), + 70, + '1970: final millisecond' +); + +assert.sameValue(new Date(2000, 0).getYear(), 100, '2000: first millisecond'); +assert.sameValue( + new Date(2000, 11, 31, 23, 59, 59, 999).getYear(), + 100, + '2000: final millisecond' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/shell.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/this-not-date.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/this-not-date.js new file mode 100644 index 0000000000..cb6888f80a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/getYear/this-not-date.js @@ -0,0 +1,28 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.getyear +es6id: B.2.4.1 +es5id: B.2.4 +description: Behavior when `this` value has no [[DateValue]] internal slot +info: | + 1. Let t be ? thisTimeValue(this value). +---*/ + +var getYear = Date.prototype.getYear; + +assert.sameValue(typeof getYear, 'function'); + +assert.throws(TypeError, function() { + getYear.call({}); +}, 'object'); + +assert.throws(TypeError, function() { + getYear.call(undefined); +}, 'undefined'); + +assert.throws(TypeError, function() { + getYear.call(null); +}, 'null'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/B.2.5.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/B.2.5.js new file mode 100644 index 0000000000..91eb6f7451 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/B.2.5.js @@ -0,0 +1,18 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: B.2.5 +description: > + Object.getOwnPropertyDescriptor returns data desc for functions on + built-ins (Date.prototype.setYear) +includes: [propertyHelper.js] +---*/ + +verifyProperty(Date.prototype, "setYear", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/browser.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/length.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/length.js new file mode 100644 index 0000000000..946c22d3d1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.4.2 +description: > + Date.prototype.setYear.length is 1. +info: | + Date.prototype.setYear ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(Date.prototype.setYear, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 1 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/name.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/name.js new file mode 100644 index 0000000000..f35e39d327 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.4.2 +description: > + Date.prototype.setYear.name is "setYear". +info: | + Date.prototype.setYear ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(Date.prototype.setYear, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "setYear" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js new file mode 100644 index 0000000000..906214fde4 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.setYear does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.setYear), + false, + 'isConstructor(Date.prototype.setYear) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.setYear(); +}, '`let date = new Date(Date.now()); new date.setYear()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/shell.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-not-date.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-not-date.js new file mode 100644 index 0000000000..15614f98e3 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-not-date.js @@ -0,0 +1,28 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.setyear +es6id: B.2.4.2 +es5id: B.2.5 +description: Behavior when "this" value has no [[DateValue]] internal slot +info: | + 1. Let t be ? thisTimeValue(this value). +---*/ + +var setYear = Date.prototype.setYear; + +assert.sameValue(typeof setYear, 'function'); + +assert.throws(TypeError, function() { + setYear.call({}, 1); +}, 'object'); + +assert.throws(TypeError, function() { + setYear.call(undefined, 1); +}, 'undefined'); + +assert.throws(TypeError, function() { + setYear.call(null, 1); +}, 'null'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-time-nan.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-time-nan.js new file mode 100644 index 0000000000..fb99ad3765 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-time-nan.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.setyear +es6id: B.2.4.2 +es5id: B.2.5 +description: > + Behavior when the [[DateValue]] internal slot of "this" value is NaN +info: | + 1. Let t be ? thisTimeValue(this value). + 2. If t is NaN, let t be +0; otherwise, let t be LocalTime(t). +---*/ + +var date = new Date({}); +var expected = new Date(1971, 0).valueOf(); + +assert.sameValue(date.setYear(71), expected, 'method return value'); +assert.sameValue(date.valueOf(), expected, '[[DateValue]] internal slot'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-time-valid.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-time-valid.js new file mode 100644 index 0000000000..35ccee0fbf --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/this-time-valid.js @@ -0,0 +1,21 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.setyear +es6id: B.2.4.2 +es5id: B.2.5 +description: > + Behavior when the [[DateValue]] internal slot of "this" value is an integer + value +info: | + 1. Let t be ? thisTimeValue(this value). + 2. If t is NaN, let t be +0; otherwise, let t be LocalTime(t). +---*/ + +var date = new Date(1970, 1, 2, 3, 4, 5); +var expected = new Date(1971, 1, 2, 3, 4, 5).valueOf(); + +assert.sameValue(date.setYear(71), expected, 'method return value'); +assert.sameValue(date.valueOf(), expected, '[[DateValue]] internal slot'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/time-clip.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/time-clip.js new file mode 100644 index 0000000000..f296e204ab --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/time-clip.js @@ -0,0 +1,36 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.setyear +es6id: B.2.4.2 +es5id: B.2.5 +description: Clipping of new time value +info: | + [...] + 9. Set the [[DateValue]] internal slot of this Date object to + TimeClip(date). + 10. Return the value of the [[DateValue]] internal slot of this Date + object. +---*/ + +var date; + +date = new Date(1970, 8, 10, 0, 0, 0, 0); + +assert.notSameValue( + date.setYear(275760), NaN, 'method return value (valid date)' +); +assert.notSameValue( + date.valueOf(), NaN, '[[DateValue]] internal slot (valid date)' +); + +date = new Date(1970, 8, 14, 0, 0, 0, 0); + +assert.sameValue( + date.setYear(275760), NaN, 'method return value (invalid date)' +); +assert.sameValue( + date.valueOf(), NaN, '[[DateValue]] internal slot (invalid date)' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-nan.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-nan.js new file mode 100644 index 0000000000..9a14f8f777 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-nan.js @@ -0,0 +1,38 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.setyear +es6id: B.2.4.2 +es5id: B.2.5 +description: Behavior when year value coerces to NaN +info: | + [...] + 3. Let y be ? ToNumber(year). + 4. If y is NaN, set the [[DateValue]] internal slot of this Date object to + NaN and return NaN. +features: [Symbol] +---*/ + +var date; + +date = new Date(); +assert.sameValue(date.setYear(), NaN, 'return value (no argument)'); +assert.sameValue( + date.valueOf(), NaN, '[[DateValue]] internal slot (no argument)' +); + +date = new Date(); +assert.sameValue(date.setYear(NaN), NaN, 'return value (literal NaN)'); +assert.sameValue( + date.valueOf(), NaN, '[[DateValue]] internal slot (literal NaN)' +); + +date = new Date(); +assert.sameValue( + date.setYear('not a number'), NaN, 'return value (NaN from ToNumber)' +); +assert.sameValue( + date.valueOf(), NaN, '[[DateValue]] internal slot (NaN from ToNumber)' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-number-absolute.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-number-absolute.js new file mode 100644 index 0000000000..61cc1d91a3 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-number-absolute.js @@ -0,0 +1,44 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.setyear +es6id: B.2.4.2 +es5id: B.2.5 +description: > + Behavior when the integer representation of the specified `year` is not + relative to 1900 +info: | + [...] + 5. If y is not NaN and 0 ≤ ToInteger(y) ≤ 99, let yyyy be ToInteger(y) + + 1900. + 6. Else, let yyyy be y. + [...] +---*/ + +var date; + +date = new Date(1970, 0); +date.setYear(-1); +assert.sameValue(date.getFullYear(), -1); + +date = new Date(1970, 0); +date.setYear(100); +assert.sameValue(date.getFullYear(), 100); + +date = new Date(1970, 0); +date.setYear(1899); +assert.sameValue(date.getFullYear(), 1899); + +date = new Date(1970, 0); +date.setYear(1900); +assert.sameValue(date.getFullYear(), 1900); + +date = new Date(1970, 0); +date.setYear(1999); +assert.sameValue(date.getFullYear(), 1999); + +date = new Date(1970, 0); +date.setYear(2000); +assert.sameValue(date.getFullYear(), 2000); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-number-relative.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-number-relative.js new file mode 100644 index 0000000000..632acfa129 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-number-relative.js @@ -0,0 +1,47 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.setyear +es6id: B.2.4.2 +es5id: B.2.5 +description: > + Behavior when the integer representation of the specified `year` is + relative to 1900 +info: | + [...] + 5. If y is not NaN and 0 ≤ ToInteger(y) ≤ 99, let yyyy be ToInteger(y) + + 1900. + [...] +---*/ + +var date; + +date = new Date(1970, 0); +date.setYear(-0.9999999); +assert.sameValue(date.getFullYear(), 1900, 'y = -0.999999'); + +date = new Date(1970, 0); +date.setYear(-0); +assert.sameValue(date.getFullYear(), 1900, 'y = -0'); + +date = new Date(1970, 0); +date.setYear(0); +assert.sameValue(date.getFullYear(), 1900, 'y = 0'); + +date = new Date(1970, 0); +date.setYear(50); +assert.sameValue(date.getFullYear(), 1950, 'y = 50'); + +date = new Date(1970, 0); +date.setYear(50.999999); +assert.sameValue(date.getFullYear(), 1950, 'y = 50.999999'); + +date = new Date(1970, 0); +date.setYear(99); +assert.sameValue(date.getFullYear(), 1999, 'y = 99'); + +date = new Date(1970, 0); +date.setYear(99.999999); +assert.sameValue(date.getFullYear(), 1999, 'y = 99.999999'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-to-number-err.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-to-number-err.js new file mode 100644 index 0000000000..d7e318f571 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/setYear/year-to-number-err.js @@ -0,0 +1,31 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.setyear +es6id: B.2.4.2 +es5id: B.2.5 +description: > + Behavior when calling ToNumber on year value returns an abrupt completion +info: | + [...] + 3. Let y be ? ToNumber(year). +features: [Symbol] +---*/ + +var date = new Date(); +var symbol = Symbol(''); +var year = { + valueOf: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + date.setYear(year); +}); + +assert.throws(TypeError, function() { + date.setYear(symbol); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/shell.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/browser.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js new file mode 100644 index 0000000000..bb6c5f412f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + Date.prototype.toGMTString does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(Date.prototype.toGMTString), + false, + 'isConstructor(Date.prototype.toGMTString) must return false' +); + +assert.throws(TypeError, () => { + let date = new Date(Date.now()); new date.toGMTString(); +}, '`let date = new Date(Date.now()); new date.toGMTString()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/prop-desc.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/prop-desc.js new file mode 100644 index 0000000000..c7f55f91a1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/prop-desc.js @@ -0,0 +1,19 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: B.2.6 +description: > + Object.getOwnPropertyDescriptor returns data desc for functions on + built-ins (Date.prototype.toGMTString) +includes: [propertyHelper.js] + +---*/ + +verifyProperty(Date.prototype, "toGMTString", { + enumerable: false, + writable: true, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/shell.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/value.js b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/value.js new file mode 100644 index 0000000000..27e9f98edd --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Date/prototype/toGMTString/value.js @@ -0,0 +1,16 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-date.prototype.togmtstring +es6id: B.2.4.3 +es5id: B.2.6 +description: Value of `Date.prototype.toGMTString` +info: | + The function object that is the initial value of Date.prototype.toGMTString + is the same function object that is the initial value of + Date.prototype.toUTCString. +---*/ + +assert.sameValue(Date.prototype.toGMTString, Date.prototype.toUTCString); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Date/shell.js b/js/src/tests/test262/annexB/built-ins/Date/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Function/browser.js b/js/src/tests/test262/annexB/built-ins/Function/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-close-comment-body.js b/js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-close-comment-body.js new file mode 100644 index 0000000000..49a409b8a6 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-close-comment-body.js @@ -0,0 +1,22 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-createdynamicfunction +description: > + Create a Function with the function body being a html close comment. +info: | + 19.2.1.1.1 Runtime Semantics: CreateDynamicFunction(constructor, newTarget, kind, args) + ... + 7. If kind is "normal", then + a. Let goal be the grammar symbol FunctionBody[~Yield, ~Await]. + ... + 11. Let body be the result of parsing bodyText, interpreted as UTF-16 encoded Unicode text + as described in 6.1.4, using goal as the goal symbol. Throw a SyntaxError exception if + the parse fails. + ... +---*/ + +Function("\n-->"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-close-comment-params.js b/js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-close-comment-params.js new file mode 100644 index 0000000000..c97834d6f4 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-close-comment-params.js @@ -0,0 +1,23 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-createdynamicfunction +description: > + Create a Function with the function parameters being a html close comment. +info: | + 19.2.1.1.1 Runtime Semantics: CreateDynamicFunction(constructor, newTarget, kind, args) + ... + 7. If kind is "normal", then + ... + b. Let parameterGoal be the grammar symbol FormalParameters[~Yield, ~Await]. + ... + 10. Let parameters be the result of parsing P, interpreted as UTF-16 encoded Unicode text + as described in 6.1.4, using parameterGoal as the goal symbol. Throw a SyntaxError + exception if the parse fails. + ... +---*/ + +Function("\n-->", ""); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-open-comment-body.js b/js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-open-comment-body.js new file mode 100644 index 0000000000..3dc973128b --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Function/createdynfn-html-open-comment-body.js @@ -0,0 +1,22 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-createdynamicfunction +description: > + Create a Function with the function body being a html open comment. +info: | + 19.2.1.1.1 Runtime Semantics: CreateDynamicFunction(constructor, newTarget, kind, args) + ... + 7. If kind is "normal", then + a. Let goal be the grammar symbol FunctionBody[~Yield, ~Await]. + ... + 11. Let body be the result of parsing bodyText, interpreted as UTF-16 encoded Unicode text + as described in 6.1.4, using goal as the goal symbol. Throw a SyntaxError exception if + the parse fails. + ... +---*/ + +Function(""); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Function/createdynfn-no-line-terminator-html-close-comment-params.js b/js/src/tests/test262/annexB/built-ins/Function/createdynfn-no-line-terminator-html-close-comment-params.js new file mode 100644 index 0000000000..73fea90809 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Function/createdynfn-no-line-terminator-html-close-comment-params.js @@ -0,0 +1,27 @@ +// Copyright (C) 2019 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-createdynamicfunction +description: > + Function parses the parameters text before forming the sourceText with the proper line feed. +info: | + The HTMLCloseComment requires a preceding line terminator. + + Runtime Semantics: CreateDynamicFunction(constructor, newTarget, kind, args) + ... + 16. Set bodyText to ? ToString(bodyText). + 17. Let parameters be the result of parsing P, interpreted as UTF-16 encoded Unicode text as + described in 6.1.4, using parameterGoal as the goal symbol. Throw a SyntaxError exception if the + parse fails. + 18. Let body be the result of parsing bodyText, interpreted as UTF-16 encoded Unicode text as + described in 6.1.4, using goal as the goal symbol. Throw a SyntaxError exception if the parse + fails. + ... + 41. Let sourceText be the string-concatenation of prefix, " anonymous(", P, 0x000A (LINE FEED), + ") {", 0x000A (LINE FEED), bodyText, 0x000A (LINE FEED), and "}". +---*/ + +assert.throws(SyntaxError, () => Function("-->", "")); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Function/shell.js b/js/src/tests/test262/annexB/built-ins/Function/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Object/browser.js b/js/src/tests/test262/annexB/built-ins/Object/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Object/is/browser.js b/js/src/tests/test262/annexB/built-ins/Object/is/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Object/is/emulates-undefined.js b/js/src/tests/test262/annexB/built-ins/Object/is/emulates-undefined.js new file mode 100644 index 0000000000..c6b4bb8417 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/Object/is/emulates-undefined.js @@ -0,0 +1,28 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-object.is +description: > + SameValue abstract op doesn't special-case [[IsHTMLDDA]] objects. +info: | + Object.is ( value1, value2 ) + + 1. Return SameValue(value1, value2). + + SameValue ( x, y ) + + 1. If Type(x) is different from Type(y), return false. +features: [IsHTMLDDA] +---*/ + +var IsHTMLDDA = $262.IsHTMLDDA; + +assert.sameValue(Object.is(IsHTMLDDA, undefined), false, "SameValue with `undefined`"); +assert.sameValue(Object.is(undefined, IsHTMLDDA), false, "SameValue with `undefined`"); + +assert.sameValue(Object.is(IsHTMLDDA, null), false, "SameValue with `null`"); +assert.sameValue(Object.is(null, IsHTMLDDA), false, "SameValue with `null`"); + +assert(Object.is(IsHTMLDDA, IsHTMLDDA)); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/Object/is/shell.js b/js/src/tests/test262/annexB/built-ins/Object/is/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/Object/shell.js b/js/src/tests/test262/annexB/built-ins/Object/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-control-escape-russian-letter.js b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-control-escape-russian-letter.js new file mode 100644 index 0000000000..b7caeb42a5 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-control-escape-russian-letter.js @@ -0,0 +1,55 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: "CharacterEscape :: c ControlLetter" +es5id: 15.10.2.10_A2.1_T3 +es6id: B.1.4 +description: > + "ControlLetter :: RUSSIAN ALPHABET is incorrect" + Instead, fall back to semantics to match literal "\\c" +features: [generators] +---*/ + +function* invalidControls() { + // Check upper case Cyrillic + for (var alpha = 0x0410; alpha <= 0x042F; alpha++) { + yield String.fromCharCode(alpha); + } + + // Check lower case Cyrillic + for (alpha = 0x0430; alpha <= 0x044F; alpha++) { + yield String.fromCharCode(alpha); + } + + // Check ASCII characters which are not in the extended range or syntax + // characters + for (alpha = 0x00; alpha <= 0x7F; alpha++) { + let letter = String.fromCharCode(alpha); + if (!letter.match(/[0-9A-Za-z_\$(|)\[\]\/\\^]/)) { + yield letter; + } + } + + // Check for end of string + yield ""; +} + +for (let letter of invalidControls()) { + var source = "\\c" + letter; + var re = new RegExp(source); + + if (letter.length > 0) { + var char = letter.charCodeAt(0); + var str = String.fromCharCode(char % 32); + var arr = re.exec(str); + assert.sameValue(arr, null, `Character ${letter} unreasonably wrapped around as a control character`); + } + arr = re.exec(source.substring(1)); + assert.sameValue(arr, null, `invalid \\c escape matched c rather than \\c when followed by ${letter}`); + + arr = re.exec(source); + assert.notSameValue(arr, null, `invalid \\c escape failed to match \\c when followed by ${letter}`); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-decimal-escape-class-range.js b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-decimal-escape-class-range.js new file mode 100644 index 0000000000..4d49de4ea4 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-decimal-escape-class-range.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + The production CharacterClass :: [ [lookahead \notin {^}] ClassRanges ] + evaluates by evaluating ClassRanges to obtain a CharSet and returning + that CharSet and the boolean false +es5id: 15.10.2.13_A1_T16 +es6id: B.1.4 +description: > + Execute /[\d][\12-\14]{1,}[^\d]/.exec("line1\n\n\n\n\nline2") and + check results +---*/ + +var __executed = /[\d][\12-\14]{1,}[^\d]/.exec("line1\n\n\n\n\nline2"); + +var __expected = ["1\n\n\n\n\nl"]; +__expected.index = 4; +__expected.input = "line1\n\n\n\n\nline2"; + +assert.sameValue(__executed.length, __expected.length, '.length'); +assert.sameValue(__executed.index, __expected.index, '.index'); +assert.sameValue(__executed.input, __expected.input, '.input'); + +//CHECK#4 +for(var index=0; index < __expected.length; index++) { + assert.sameValue(__executed[index], __expected[index], 'index: ' + index); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-decimal-escape-not-capturing.js b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-decimal-escape-not-capturing.js new file mode 100644 index 0000000000..cd0bf7ed7e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-decimal-escape-not-capturing.js @@ -0,0 +1,20 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + An escape sequence of the form \ followed by a nonzero decimal number n + matches the result of the nth set of capturing parentheses (see + 15.10.2.11) +es5id: 15.10.2.9_A1_T4 +es6id: B.1.4 +description: > + Execute /\b(\w+) \2\b/.test("do you listen the the band") and + check results +---*/ + +var executed = /\b(\w+) \2\b/.test("do you listen the the band"); + +assert.sameValue(executed, false); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class-range.js b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class-range.js new file mode 100644 index 0000000000..011790acdf --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class-range.js @@ -0,0 +1,26 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-annexB-ClassAtomNoDash +description: > + Invalid \c in a range behaves like [\\c-_] +info: | + ClassAtomNoDash :: `\` + + The production ClassAtomNoDash :: `\` evaluates as follows: + 1. Return the CharSet containing the single character `\`. +---*/ + +let re = /[\\c-f]/ + +assert(re.test("\\")) +assert(!re.test("b")) +assert(re.test("c")) +assert(re.test("d")) +assert(re.test("e")) +assert(re.test("f")) +assert(!re.test("g")) +assert(!re.test("-")) + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class.js b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class.js new file mode 100644 index 0000000000..0e9451e537 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-invalid-control-escape-character-class.js @@ -0,0 +1,56 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-annexB-ClassAtomNoDash +description: > + Character classes containing an invalid control escape behave like [\\c] +info: | + ClassAtomNoDash :: `\` + + The production ClassAtomNoDash :: `\` evaluates as follows: + 1. Return the CharSet containing the single character `\`. +features: [generators] +---*/ + +function* invalidControls() { + // Check ASCII characters which are not in the extended range or syntax + // characters + for (let alpha = 0x00; alpha <= 0x7F; alpha++) { + let letter = String.fromCharCode(alpha); + if (!letter.match(/[0-9A-Za-z_\$(|)\[\]\/\\^]/)) { + yield letter; + } + } + yield ""; +} + +for (let letter of invalidControls()) { + var source = "[\\c" + letter + "]"; + var re = new RegExp(source); + + if (letter.length > 0) { + var char = letter.charCodeAt(0); + var str = String.fromCharCode(char % 32); + var arr = re.exec(str); + if (str !== letter && arr !== null) { + throw new Test262Error(`Character ${letter} unreasonably wrapped around as a control character`); + } + + arr = re.exec(letter); + if (arr === null) { + throw new Test262Error(`Character ${letter} missing from character class ${source}`); + } + } + arr = re.exec("\\") + if (arr === null) { + throw new Test262Error(`Character \\ missing from character class ${source}`); + } + arr = re.exec("c") + if (arr === null) { + throw new Test262Error(`Character c missing from character class ${source}`); + } +} + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-leading-escape-BMP.js b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-leading-escape-BMP.js new file mode 100644 index 0000000000..011e7aeac6 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-leading-escape-BMP.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + RegularExpressionFirstChar :: BackslashSequence :: \NonTerminator, + RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty] +es5id: 7.8.5_A1.4_T2 +es6id: 11.8.5 +description: Complex test with eval, using syntax pattern +---*/ + +for (var cu = 0; cu <= 0xffff; ++cu) { + var Elimination = + ((cu === 0x002A) || (cu === 0x002F) || (cu === 0x005C) || (cu === 0x002B) || + (cu === 0x003F) || (cu === 0x0028) || (cu === 0x0029) || + (cu === 0x005B) || (cu === 0x005D) || (cu === 0x007B) || (cu === 0x007D)); + /* + * \u002A / \u002F \ \u005C + \u002B + ? \u003F ( \u0028 ) \u0029 + [ \u005B ] \u005D { \u007B } \u007D + */ + var LineTerminator = ((cu === 0x000A) || (cu === 0x000D) || (cu === 0x2028) || (cu === 0x2029)); + if ((Elimination || LineTerminator ) === false) { + var xx = "\\" + String.fromCharCode(cu); + var pattern = eval("/" + xx + "/"); + assert.sameValue(pattern.source, xx, "Code unit: " + cu.toString(16)); + } +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-leading-escape.js b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-leading-escape.js new file mode 100644 index 0000000000..4b6c50fb00 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-leading-escape.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + RegularExpressionFirstChar :: BackslashSequence :: \NonTerminator, + RegularExpressionChars :: [empty], RegularExpressionFlags :: [empty] +es5id: 7.8.5_A1.4_T1 +es6id: 11.8.5 +description: Check similar to (/\1/.source === "\\1") +---*/ + +assert.sameValue(/\1/.source, "\\1"); +assert.sameValue(/\a/.source, "\\a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-trailing-escape-BMP.js b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-trailing-escape-BMP.js new file mode 100644 index 0000000000..76ad15761d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-trailing-escape-BMP.js @@ -0,0 +1,31 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + RegularExpressionChar :: BackslashSequence :: \NonTerminator, + RegularExpressionFlags :: [empty] +es5id: 7.8.5_A2.4_T2 +es6id: 11.8.5 +description: Complex test with eval, using syntax pattern +---*/ + +for (var cu = 0; cu <= 0xffff; ++cu) { + var Elimination = + ((cu === 0x002A) || (cu === 0x002F) || (cu === 0x005C) || (cu === 0x002B) || + (cu === 0x003F) || (cu === 0x0028) || (cu === 0x0029) || + (cu === 0x005B) || (cu === 0x005D) || (cu === 0x007B) || (cu === 0x007D)); + /* + * \u002A / \u002F \ \u005C + \u002B + ? \u003F ( \u0028 ) \u0029 + [ \u005B ] \u005D { \u007B } \u007D + */ + var LineTerminator = ((cu === 0x000A) || (cu === 0x000D) || (cu === 0x2028) || (cu === 0x2029)); + if ((Elimination || LineTerminator ) === false) { + var xx = "a\\" + String.fromCharCode(cu); + var pattern = eval("/" + xx + "/"); + assert.sameValue(pattern.source, xx, "Code unit: " + cu.toString(16)); + } +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-trailing-escape.js b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-trailing-escape.js new file mode 100644 index 0000000000..9af5e0ccf9 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/RegExp-trailing-escape.js @@ -0,0 +1,16 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: | + RegularExpressionChar :: BackslashSequence :: \NonTerminator, + RegularExpressionFlags :: [empty] +es5id: 7.8.5_A2.4_T1 +es6id: 11.8.5 +description: Check similar to (/a\1/.source === "a\\1") +---*/ + +assert.sameValue(/a\1/.source, "a\\1"); +assert.sameValue(/a\a/.source, "a\\a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/incomplete_hex_unicode_escape.js b/js/src/tests/test262/annexB/built-ins/RegExp/incomplete_hex_unicode_escape.js new file mode 100644 index 0000000000..915c303f3f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/incomplete_hex_unicode_escape.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 Zirak. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: An incomplete HexEscape or UnicodeEscape should be treated as an Identity Escape +info: | + An incomplete HexEscape (e.g. /\x/) or UnicodeEscape (/\u/) should fall + through to IdentityEscape +esid: prod-AtomEscape +---*/ + +// Hex escape +assert(/\x/.test("x"), "/\\x/"); +assert(/\xa/.test("xa"), "/\\xa/"); + +// Unicode escape +assert(/\u/.test("u"), "/\\u/"); +assert(/\ua/.test("ua"), "/\\ua/"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/prop-desc.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/prop-desc.js new file mode 100644 index 0000000000..7f11026dbc --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/prop-desc.js @@ -0,0 +1,35 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: Property descriptor for RegExp.$1-$9 +info: | + RegExp.$1-$9 are accessor properties with attributes + { + [[Enumerable]]: false, + [[Configurable]]: true, + [[Set]]: undefined, + } + + get RegExp.$1-$9 + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpParen1-9]]). +includes: [propertyHelper.js] +features: [legacy-regexp] +---*/ + +for (let i = 1; i <= 9; i++) { + const property = "$" + i; + const desc = Object.getOwnPropertyDescriptor(RegExp, property); + + assert.sameValue(desc.set, undefined, property + " setter"); + assert.sameValue(typeof desc.get, "function", property + " getter"); + + verifyProperty(RegExp, property, { + enumerable: false, + configurable: true + }); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-cross-realm-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-cross-realm-constructor.js new file mode 100644 index 0000000000..885e64fcc0 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-cross-realm-constructor.js @@ -0,0 +1,33 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.$1-$9 throw a TypeError for cross-realm receiver +info: | + get RegExp.$1-$9 + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpParen1-9]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,cross-realm,Reflect] +---*/ + +const other = $262.createRealm().global; + +for (let i = 1; i <= 9; i++) { + const property = "$" + i; + assert.throws( + TypeError, + function () { + Reflect.get(RegExp, property, other.RegExp); + }, + "RegExp." + property + " getter throws for cross-realm receiver" + ); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-not-regexp-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-not-regexp-constructor.js new file mode 100644 index 0000000000..5afd16c0fb --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-not-regexp-constructor.js @@ -0,0 +1,63 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.$1-$9 throw a TypeError for non-%RegExp% receiver +info: | + get RegExp.$1-$9 + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpParen1-9]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp] +---*/ + +for (let i = 1; i <= 9; i++) { + const property = "$" + i; + const desc = Object.getOwnPropertyDescriptor(RegExp, property); + + // Similar to the other test verifying the descriptor, but split as properties can be removed or changed + assert.sameValue(typeof desc.get, "function", property + " getter"); + + // If SameValue(C, thisValue) is false, throw a TypeError exception. + assert.throws( + TypeError, + function () { + desc.get(); + }, + "RegExp." + property + " getter throws for property descriptor receiver" + ); + + assert.throws( + TypeError, + function () { + desc.get.call(/ /); + }, + "RegExp." + property + " getter throws for RegExp instance receiver" + ); + + assert.throws( + TypeError, + function () { + desc.get.call(RegExp.prototype); + }, + "RegExp." + property + " getter throws for %RegExp.prototype% receiver" + ); + + [undefined, null, {}, true, false, 0, 1, "string"].forEach(function (value) { + assert.throws( + TypeError, + function () { + desc.get.call(value); + }, + "RegExp." + property + ' getter throws for primitive "' + value + '" receiver' + ); + }); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-subclass-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-subclass-constructor.js new file mode 100644 index 0000000000..99970a8332 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/index/this-subclass-constructor.js @@ -0,0 +1,33 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.$1-$9 throw a TypeError for subclass receiver +info: | + get RegExp.$1-$9 + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpParen1-9]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,class] +---*/ + +class MyRegExp extends RegExp {} + +for (let i = 1; i <= 9; i++) { + const property = "$" + i; + assert.throws( + TypeError, + function () { + MyRegExp[property]; + }, + "RegExp." + property + " getter throws for subclass receiver" + ); +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/prop-desc.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/prop-desc.js new file mode 100644 index 0000000000..e5f0c85603 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/prop-desc.js @@ -0,0 +1,45 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: Property descriptor for RegExp.input +info: | + RegExp.input is an accessor property with attributes: + { + [[Enumerable]]: false, + [[Configurable]]: true, + } + + get RegExp.input + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpInput]]). + + set RegExp.input = val + + 1. Return ? SetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpInput]], val). +includes: [propertyHelper.js] +features: [legacy-regexp] +---*/ + +var desc = Object.getOwnPropertyDescriptor(RegExp, "input"); + +assert.sameValue(typeof desc.get, "function", "`get` property"); +assert.sameValue(typeof desc.set, "function", "`set` property"); + +verifyProperty(RegExp, "input", { + enumerable: false, + configurable: true +}); + +desc = Object.getOwnPropertyDescriptor(RegExp, "$_"); + +assert.sameValue(typeof desc.get, "function", "`get` property"); +assert.sameValue(typeof desc.set, "function", "`set` property"); + +verifyProperty(RegExp, "$_", { + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-cross-realm-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-cross-realm-constructor.js new file mode 100644 index 0000000000..a7f0446619 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-cross-realm-constructor.js @@ -0,0 +1,64 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.input throws a TypeError for cross-realm receiver +info: | + get RegExp.input + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpInput]]). + + set RegExp.input = val + + 1. Return ? SetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpInput]], val). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... + + SetLegacyRegExpStaticProperty( C, thisValue, internalSlotName, val ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,cross-realm,Reflect,Reflect.set] +---*/ + +const other = $262.createRealm().global; + +assert.throws( + TypeError, + function () { + Reflect.get(RegExp, "input", other.RegExp); + }, + "RegExp.input getter throws for cross-realm receiver" +); + +assert.throws( + TypeError, + function () { + Reflect.set(RegExp, "input", "", other.RegExp); + }, + "RegExp.input setter throws for cross-realm receiver" +); + +assert.throws( + TypeError, + function () { + Reflect.get(RegExp, "$_", other.RegExp); + }, + "RegExp.$_ getter throws for cross-realm receiver" +); + +assert.throws( + TypeError, + function () { + Reflect.set(RegExp, "$_", "", other.RegExp); + }, + "RegExp.$_ setter throws for cross-realm receiver" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-not-regexp-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-not-regexp-constructor.js new file mode 100644 index 0000000000..4a8a7ff3c6 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-not-regexp-constructor.js @@ -0,0 +1,76 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.input throws a TypeError for non-%RegExp% receiver +info: | + get RegExp.input + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpInput]]). + + set RegExp.input = val + + 1. Return ? SetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpInput]], val). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... + + SetLegacyRegExpStaticProperty( C, thisValue, internalSlotName, val ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp] +---*/ + +["input", "$_"].forEach(function (property) { + const desc = Object.getOwnPropertyDescriptor(RegExp, property); + + ["get", "set"].forEach(function (accessor) { + const messagePrefix = "RegExp." + property + " " + accessor + "ter"; + + // Similar to the other test verifying the descriptor, but split as properties can be removed or changed + assert.sameValue(typeof desc[accessor], "function", messagePrefix); + + // If SameValue(C, thisValue) is false, throw a TypeError exception. + assert.throws( + TypeError, + function () { + desc[accessor](); + }, + messagePrefix + " throws for property descriptor receiver" + ); + + assert.throws( + TypeError, + function () { + desc[accessor].call(/ /); + }, + messagePrefix + " throws for RegExp instance receiver" + ); + + assert.throws( + TypeError, + function () { + desc[accessor].call(RegExp.prototype); + }, + messagePrefix + " throws for %RegExp.prototype% receiver" + ); + + [undefined, null, {}, true, false, 0, 1, "string"].forEach(function (value) { + assert.throws( + TypeError, + function () { + desc[accessor].call(value); + }, + messagePrefix + ' throws for primitive "' + value + '" receiver' + ); + }); + }); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-subclass-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-subclass-constructor.js new file mode 100644 index 0000000000..beb7c8c66d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/input/this-subclass-constructor.js @@ -0,0 +1,64 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.input throws a TypeError for subclass receiver +info: | + get RegExp.input + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpInput]]). + + set RegExp.input = val + + 1. Return ? SetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpInput]], val). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... + + SetLegacyRegExpStaticProperty( C, thisValue, internalSlotName, val ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,class] +---*/ + +class MyRegExp extends RegExp {} + +assert.throws( + TypeError, + function () { + MyRegExp.input; + }, + "RegExp.input getter throws for subclass receiver" +); + +assert.throws( + TypeError, + function () { + MyRegExp.input = ""; + }, + "RegExp.input setter throws for subclass receiver" +); + +assert.throws( + TypeError, + function () { + MyRegExp.$_; + }, + "RegExp.$_ getter throws for subclass receiver" +); + +assert.throws( + TypeError, + function () { + MyRegExp.$_ = ""; + }, + "RegExp.$_ setter throws for subclass receiver" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/prop-desc.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/prop-desc.js new file mode 100644 index 0000000000..62854362c5 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/prop-desc.js @@ -0,0 +1,42 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: Property descriptor for RegExp.lastMatch +info: | + RegExp.lastMatch is an accessor property with attributes: + { + [[Enumerable]]: false, + [[Configurable]]: true, + [[Set]]: undefined, + } + + get RegExp.lastMatch + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLastMatch]]). +includes: [propertyHelper.js] +features: [legacy-regexp] +---*/ + +var desc = Object.getOwnPropertyDescriptor(RegExp, "lastMatch"); + +assert.sameValue(desc.set, undefined, "`set` property"); +assert.sameValue(typeof desc.get, "function", "`get` property"); + +verifyProperty(RegExp, "lastMatch", { + enumerable: false, + configurable: true +}); + +desc = Object.getOwnPropertyDescriptor(RegExp, "$&"); + +assert.sameValue(desc.set, undefined, "`set` property"); +assert.sameValue(typeof desc.get, "function", "`get` property"); + +verifyProperty(RegExp, "$&", { + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-cross-realm-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-cross-realm-constructor.js new file mode 100644 index 0000000000..c9b7c97abc --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-cross-realm-constructor.js @@ -0,0 +1,38 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.lastMatch throws a TypeError for cross-realm receiver +info: | + get RegExp.lastMatch + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLastMatch]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,cross-realm,Reflect] +---*/ + +const other = $262.createRealm().global; + +assert.throws( + TypeError, + function () { + Reflect.get(RegExp, "lastMatch", other.RegExp); + }, + "RegExp.lastMatch getter throws for cross-realm receiver" +); + +assert.throws( + TypeError, + function () { + Reflect.get(RegExp, "$&", other.RegExp); + }, + "RegExp.$& getter throws for cross-realm receiver" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-not-regexp-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-not-regexp-constructor.js new file mode 100644 index 0000000000..35ad7711f6 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-not-regexp-constructor.js @@ -0,0 +1,62 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.lastMatch throws a TypeError for non-%RegExp% receiver +info: | + get RegExp.lastMatch + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLastMatch]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp] +---*/ + +["lastMatch", "$&"].forEach(function (property) { + const desc = Object.getOwnPropertyDescriptor(RegExp, property); + + // Similar to the other test verifying the descriptor, but split as properties can be removed or changed + assert.sameValue(typeof desc.get, "function", property + " getter"); + + // If SameValue(C, thisValue) is false, throw a TypeError exception. + assert.throws( + TypeError, + function () { + desc.get(); + }, + "RegExp." + property + " getter throws for property descriptor receiver" + ); + + assert.throws( + TypeError, + function () { + desc.get.call(/ /); + }, + "RegExp." + property + " getter throws for RegExp instance receiver" + ); + + assert.throws( + TypeError, + function () { + desc.get.call(RegExp.prototype); + }, + "RegExp." + property + " getter throws for %RegExp.prototype% receiver" + ); + + [undefined, null, {}, true, false, 0, 1, "string"].forEach(function (value) { + assert.throws( + TypeError, + function () { + desc.get.call(value); + }, + "RegExp." + property + ' getter throws for primitive "' + value + '" receiver' + ); + }); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-subclass-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-subclass-constructor.js new file mode 100644 index 0000000000..510697fd06 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastMatch/this-subclass-constructor.js @@ -0,0 +1,38 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.lastMatch throws a TypeError for subclass receiver +info: | + get RegExp.lastMatch + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLastMatch]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,class] +---*/ + +class MyRegExp extends RegExp {} + +assert.throws( + TypeError, + function () { + MyRegExp.lastMatch; + }, + "RegExp.lastMatch getter throws for subclass receiver" +); + +assert.throws( + TypeError, + function () { + MyRegExp["$&"]; + }, + "RegExp.$& getter throws for subclass receiver" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/prop-desc.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/prop-desc.js new file mode 100644 index 0000000000..cc8c0adc10 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/prop-desc.js @@ -0,0 +1,42 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: Property descriptor for RegExp.lastParen +info: | + RegExp.lastParen is an accessor property with attributes: + { + [[Enumerable]]: false, + [[Configurable]]: true, + [[Set]]: undefined, + } + + get RegExp.lastParen + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLastParen]]). +includes: [propertyHelper.js] +features: [legacy-regexp] +---*/ + +var desc = Object.getOwnPropertyDescriptor(RegExp, "lastParen"); + +assert.sameValue(desc.set, undefined, "`set` property"); +assert.sameValue(typeof desc.get, "function", "`get` property"); + +verifyProperty(RegExp, "lastParen", { + enumerable: false, + configurable: true +}); + +desc = Object.getOwnPropertyDescriptor(RegExp, "$+"); + +assert.sameValue(desc.set, undefined, "`set` property"); +assert.sameValue(typeof desc.get, "function", "`get` property"); + +verifyProperty(RegExp, "$+", { + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-cross-realm-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-cross-realm-constructor.js new file mode 100644 index 0000000000..39b723d8d9 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-cross-realm-constructor.js @@ -0,0 +1,38 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.lastParen throws a TypeError for cross-realm receiver +info: | + get RegExp.lastParen + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLastParen]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,cross-realm,Reflect] +---*/ + +const other = $262.createRealm().global; + +assert.throws( + TypeError, + function () { + Reflect.get(RegExp, "lastParen", other.RegExp); + }, + "RegExp.lastParen getter throws for cross-realm receiver" +); + +assert.throws( + TypeError, + function () { + Reflect.get(RegExp, "$+", other.RegExp); + }, + "RegExp.$+ getter throws for cross-realm receiver" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-not-regexp-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-not-regexp-constructor.js new file mode 100644 index 0000000000..bd36699732 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-not-regexp-constructor.js @@ -0,0 +1,62 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.lastParen throws a TypeError for non-%RegExp% receiver +info: | + get RegExp.lastParen + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLastParen]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp] +---*/ + +["lastParen", "$+"].forEach(function (property) { + const desc = Object.getOwnPropertyDescriptor(RegExp, property); + + // Similar to the other test verifying the descriptor, but split as properties can be removed or changed + assert.sameValue(typeof desc.get, "function", property + " getter"); + + // If SameValue(C, thisValue) is false, throw a TypeError exception. + assert.throws( + TypeError, + function () { + desc.get(); + }, + "RegExp." + property + " getter throws for property descriptor receiver" + ); + + assert.throws( + TypeError, + function () { + desc.get.call(/ /); + }, + "RegExp." + property + " getter throws for RegExp instance receiver" + ); + + assert.throws( + TypeError, + function () { + desc.get.call(RegExp.prototype); + }, + "RegExp." + property + " getter throws for %RegExp.prototype% receiver" + ); + + [undefined, null, {}, true, false, 0, 1, "string"].forEach(function (value) { + assert.throws( + TypeError, + function () { + desc.get.call(value); + }, + "RegExp." + property + ' getter throws for primitive "' + value + '" receiver' + ); + }); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-subclass-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-subclass-constructor.js new file mode 100644 index 0000000000..36fdf2cd3c --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/lastParen/this-subclass-constructor.js @@ -0,0 +1,38 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.lastParen throws a TypeError for subclass receiver +info: | + get RegExp.lastParen + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLastParen]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,class] +---*/ + +class MyRegExp extends RegExp {} + +assert.throws( + TypeError, + function () { + MyRegExp.lastParen; + }, + "RegExp.lastParen getter throws for subclass receiver" +); + +assert.throws( + TypeError, + function () { + MyRegExp["$+"]; + }, + "RegExp.$+ getter throws for subclass receiver" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/prop-desc.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/prop-desc.js new file mode 100644 index 0000000000..7504bdab79 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/prop-desc.js @@ -0,0 +1,42 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: Property descriptor for RegExp.leftContext +info: | + RegExp.leftContext is an accessor property with attributes: + { + [[Enumerable]]: false, + [[Configurable]]: true, + [[Set]]: undefined, + } + + get RegExp.leftContext + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLeftContext]]). +includes: [propertyHelper.js] +features: [legacy-regexp] +---*/ + +var desc = Object.getOwnPropertyDescriptor(RegExp, "leftContext"); + +assert.sameValue(desc.set, undefined, "`set` property"); +assert.sameValue(typeof desc.get, "function", "`get` property"); + +verifyProperty(RegExp, "leftContext", { + enumerable: false, + configurable: true +}); + +desc = Object.getOwnPropertyDescriptor(RegExp, "$`"); + +assert.sameValue(desc.set, undefined, "`set` property"); +assert.sameValue(typeof desc.get, "function", "`get` property"); + +verifyProperty(RegExp, "$`", { + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-cross-realm-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-cross-realm-constructor.js new file mode 100644 index 0000000000..ba4d23f90e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-cross-realm-constructor.js @@ -0,0 +1,38 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.leftContext throws a TypeError for cross-realm receiver +info: | + get RegExp.leftContext + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLeftContext]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,cross-realm,Reflect] +---*/ + +const other = $262.createRealm().global; + +assert.throws( + TypeError, + function () { + Reflect.get(RegExp, "leftContext", other.RegExp); + }, + "RegExp.leftContext getter throws for cross-realm receiver" +); + +assert.throws( + TypeError, + function () { + Reflect.get(RegExp, "$`", other.RegExp); + }, + "RegExp.$` getter throws for cross-realm receiver" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-not-regexp-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-not-regexp-constructor.js new file mode 100644 index 0000000000..a25bd49cad --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-not-regexp-constructor.js @@ -0,0 +1,62 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.leftContext throws a TypeError for non-%RegExp% receiver +info: | + get RegExp.leftContext + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLeftContext]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp] +---*/ + +["leftContext", "$`"].forEach(function (property) { + const desc = Object.getOwnPropertyDescriptor(RegExp, property); + + // Similar to the other test verifying the descriptor, but split as properties can be removed or changed + assert.sameValue(typeof desc.get, "function", property + " getter"); + + // If SameValue(C, thisValue) is false, throw a TypeError exception. + assert.throws( + TypeError, + function () { + desc.get(); + }, + "RegExp." + property + " getter throws for property descriptor receiver" + ); + + assert.throws( + TypeError, + function () { + desc.get.call(/ /); + }, + "RegExp." + property + " getter throws for RegExp instance receiver" + ); + + assert.throws( + TypeError, + function () { + desc.get.call(RegExp.prototype); + }, + "RegExp." + property + " getter throws for %RegExp.prototype% receiver" + ); + + [undefined, null, {}, true, false, 0, 1, "string"].forEach(function (value) { + assert.throws( + TypeError, + function () { + desc.get.call(value); + }, + "RegExp." + property + ' getter throws for primitive "' + value + '" receiver' + ); + }); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-subclass-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-subclass-constructor.js new file mode 100644 index 0000000000..7eba961283 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/leftContext/this-subclass-constructor.js @@ -0,0 +1,38 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.leftContext throws a TypeError for subclass receiver +info: | + get RegExp.leftContext + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpLeftContext]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,class] +---*/ + +class MyRegExp extends RegExp {} + +assert.throws( + TypeError, + function () { + MyRegExp.leftContext; + }, + "RegExp.leftContext getter throws for subclass receiver" +); + +assert.throws( + TypeError, + function () { + MyRegExp["$`"]; + }, + "RegExp.$` getter throws for subclass receiver" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/prop-desc.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/prop-desc.js new file mode 100644 index 0000000000..748a09a522 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/prop-desc.js @@ -0,0 +1,42 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: Property descriptor for RegExp.rightContext +info: | + RegExp.rightContext is an accessor property with attributes: + { + [[Enumerable]]: false, + [[Configurable]]: true, + [[Set]]: undefined, + } + + get RegExp.rightContext + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpRightContext]]). +includes: [propertyHelper.js] +features: [legacy-regexp] +---*/ + +var desc = Object.getOwnPropertyDescriptor(RegExp, "rightContext"); + +assert.sameValue(desc.set, undefined, "`set` property"); +assert.sameValue(typeof desc.get, "function", "`get` property"); + +verifyProperty(RegExp, "rightContext", { + enumerable: false, + configurable: true +}); + +desc = Object.getOwnPropertyDescriptor(RegExp, "$'"); + +assert.sameValue(desc.set, undefined, "`set` property"); +assert.sameValue(typeof desc.get, "function", "`get` property"); + +verifyProperty(RegExp, "$'", { + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-cross-realm-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-cross-realm-constructor.js new file mode 100644 index 0000000000..321f8d6707 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-cross-realm-constructor.js @@ -0,0 +1,38 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.rightContext throws a TypeError for cross-realm receiver +info: | + get RegExp.rightContext + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpRightContext]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,cross-realm,Reflect] +---*/ + +const other = $262.createRealm().global; + +assert.throws( + TypeError, + function () { + Reflect.get(RegExp, "rightContext", other.RegExp); + }, + "RegExp.rightContext getter throws for cross-realm receiver" +); + +assert.throws( + TypeError, + function () { + Reflect.get(RegExp, "$'", other.RegExp); + }, + "RegExp.$' getter throws for cross-realm receiver" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-not-regexp-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-not-regexp-constructor.js new file mode 100644 index 0000000000..01b5c065c9 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-not-regexp-constructor.js @@ -0,0 +1,62 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.rightContext throws a TypeError for non-%RegExp% receiver +info: | + get RegExp.rightContext + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpRightContext]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp] +---*/ + +["rightContext", "$'"].forEach(function (property) { + const desc = Object.getOwnPropertyDescriptor(RegExp, property); + + // Similar to the other test verifying the descriptor, but split as properties can be removed or changed + assert.sameValue(typeof desc.get, "function", property + " getter"); + + // If SameValue(C, thisValue) is false, throw a TypeError exception. + assert.throws( + TypeError, + function () { + desc.get(); + }, + "RegExp." + property + " getter throws for property descriptor receiver" + ); + + assert.throws( + TypeError, + function () { + desc.get.call(/ /); + }, + "RegExp." + property + " getter throws for RegExp instance receiver" + ); + + assert.throws( + TypeError, + function () { + desc.get.call(RegExp.prototype); + }, + "RegExp." + property + " getter throws for %RegExp.prototype% receiver" + ); + + [undefined, null, {}, true, false, 0, 1, "string"].forEach(function (value) { + assert.throws( + TypeError, + function () { + desc.get.call(value); + }, + "RegExp." + property + ' getter throws for primitive "' + value + '" receiver' + ); + }); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-subclass-constructor.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-subclass-constructor.js new file mode 100644 index 0000000000..4dbc82e23c --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/rightContext/this-subclass-constructor.js @@ -0,0 +1,38 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: pending +description: RegExp.rightContext throws a TypeError for subclass receiver +info: | + get RegExp.rightContext + + 1. Return ? GetLegacyRegExpStaticProperty(%RegExp%, this value, [[RegExpRightContext]]). + + GetLegacyRegExpStaticProperty( C, thisValue, internalSlotName ). + + 1. Assert C is an object that has an internal slot named internalSlotName. + 2. If SameValue(C, thisValue) is false, throw a TypeError exception. + 3. ... +features: [legacy-regexp,class] +---*/ + +class MyRegExp extends RegExp {} + +assert.throws( + TypeError, + function () { + MyRegExp.rightContext; + }, + "RegExp.rightContext getter throws for subclass receiver" +); + +assert.throws( + TypeError, + function () { + MyRegExp["$'"]; + }, + "RegExp.$' getter throws for subclass receiver" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/legacy-accessors/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed-lookbehind.js b/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed-lookbehind.js new file mode 100644 index 0000000000..9c8ab7ba6b --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed-lookbehind.js @@ -0,0 +1,17 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: prod-GroupSpecifier +description: > + \k is parsed as IdentityEscape as look-behind assertion is not a GroupName. +features: [regexp-named-groups, regexp-lookbehind] +---*/ + +assert(/\k(?<=>)a/.test("ka")); +assert(/(?<=>)\k/.test(">k")); + +assert(/\k(?a")); +assert(/(?)\k/.test("k")); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js b/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js new file mode 100644 index 0000000000..b7dd55db09 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/non-unicode-malformed.js @@ -0,0 +1,27 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: > + Named groups in Unicode RegExps have some syntax errors and some + compatibility escape fallback behavior. +esid: prod-GroupSpecifier +features: [regexp-named-groups] +includes: [compareArray.js] +---*/ + +assert(/\k/.test("k")); +assert(/\k<4>/.test("k<4>")); +assert(/\k\a)/.test("a")); + +assert.compareArray(["k"], "xxxkxxx".match(/\k/)); +assert.compareArray(["kxxx".match(/\k(x)/.test("kx")); +assert(/\k\1/.test("k\x01")); +assert(/\1(b)\k/.test("bk")); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/named-groups/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/Symbol.match-getter-recompiles-source.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/Symbol.match-getter-recompiles-source.js new file mode 100644 index 0000000000..41e8cbaf19 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/Symbol.match-getter-recompiles-source.js @@ -0,0 +1,37 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-regexp.prototype-@@split +description: > + Side-effects in IsRegExp may recompile the regular expression. +info: | + 21.2.5.11 RegExp.prototype [ @@split ] ( string, limit ) + ... + 4. Let C be ? SpeciesConstructor(rx, %RegExp%). + ... + 10. Let splitter be ? Construct(C, « rx, newFlags »). + ... + + 21.2.3.1 RegExp ( pattern, flags ) + 1. Let patternIsRegExp be ? IsRegExp(pattern). + ... + +features: [Symbol.match, Symbol.split] +---*/ + +var regExp = /a/; +Object.defineProperty(regExp, Symbol.match, { + get: function() { + regExp.compile("b"); + } +}); + +var result = regExp[Symbol.split]("abba"); + +assert.sameValue(result.length, 3); +assert.sameValue(result[0], "a"); +assert.sameValue(result[1], ""); +assert.sameValue(result[2], "a"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/toint32-limit-recompiles-source.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/toint32-limit-recompiles-source.js new file mode 100644 index 0000000000..351407cf65 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/Symbol.split/toint32-limit-recompiles-source.js @@ -0,0 +1,34 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-regexp.prototype-@@split +description: > + Side-effects in ToUint32 may recompile the regular expression. +info: | + 21.2.5.11 RegExp.prototype [ @@split ] ( string, limit ) + ... + 10. Let splitter be ? Construct(C, « rx, newFlags »). + ... + 13. If limit is undefined, let lim be 2^32-1; else let lim be ? ToUint32(limit). + ... + +features: [Symbol.split] +---*/ + +var regExp = /a/; +var limit = { + valueOf: function() { + regExp.compile("b"); + return -1; + } +}; + +var result = regExp[Symbol.split]("abba", limit); + +assert.sameValue(result.length, 3); +assert.sameValue(result[0], ""); +assert.sameValue(result[1], "bb"); +assert.sameValue(result[2], ""); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/B.RegExp.prototype.compile.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/B.RegExp.prototype.compile.js new file mode 100644 index 0000000000..52b6cfa331 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/B.RegExp.prototype.compile.js @@ -0,0 +1,18 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.5.1 +description: > + Object.getOwnPropertyDescriptor returns data desc for functions on + built-ins (RegExp.prototype.compile) +includes: [propertyHelper.js] +---*/ + +verifyProperty(RegExp.prototype, "compile", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/duplicate-named-capturing-groups-syntax.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/duplicate-named-capturing-groups-syntax.js new file mode 100644 index 0000000000..a1ac2676a1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/duplicate-named-capturing-groups-syntax.js @@ -0,0 +1,23 @@ +// |reftest| skip -- regexp-duplicate-named-groups is not supported +// Copyright 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-regexp.prototype.compile +description: Runtime parsing of syntax for duplicate named capturing groups +features: [regexp-duplicate-named-groups] +---*/ + +let r = /[ab]/; + +assert.throws( + SyntaxError, + () => r.compile("(?a)(?b)"), + "Duplicate named capturing groups in the same alternative do not parse" +); + +let source = "(?a)|(?b)"; +r.compile(source); +assert.sameValue(r.source, source, "Duplicate named capturing groups in separate alternatives parse correctly"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-string-invalid.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-string-invalid.js new file mode 100644 index 0000000000..a7c8493656 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-string-invalid.js @@ -0,0 +1,45 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: Behavior when flags is a string describing an invalid flag set +info: | + [...] + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + [...] + 3. If flags is undefined, let F be the empty String. + 4. Else, let F be ? ToString(flags). + 5. If F contains any code unit other than "g", "i", "m", "u", or "y" or if + it contains the same code unit more than once, throw a SyntaxError + exception. +---*/ + +var subject = /abcd/ig; + +assert.throws(SyntaxError, function() { + subject.compile('', 'igi'); +}, 'invalid flags: igi'); + +assert.throws(SyntaxError, function() { + subject.compile('', 'gI'); +}, 'invalid flags: gI'); + +assert.throws(SyntaxError, function() { + subject.compile('', 'w'); +}, 'invalid flags: w'); + +assert.sameValue( + subject.toString(), + new RegExp('abcd', 'ig').toString(), + '[[OriginalSource]] internal slot' +); + +assert.sameValue( + subject.test('AbCD'), true, '[[RegExpMatcher]] internal slot' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-to-string-err.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-to-string-err.js new file mode 100644 index 0000000000..1fad177bd1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-to-string-err.js @@ -0,0 +1,45 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: Behavior when provided flags cannot be coerced to a string +info: | + [...] + 3. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal + slot, then + a. If flags is not undefined, throw a TypeError exception. + b. Let P be the value of pattern's [[OriginalSource]] internal slot. + c. Let F be the value of pattern's [[OriginalFlags]] internal slot. + 4. Else, + [...] + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + [...] + 3. If flags is undefined, let F be the empty String. + 4. Else, let F be ? ToString(flags). +features: [Symbol] +---*/ + +var symbol = Symbol(''); +var subject = /./; +var badToString = { + toString: function() { + throw new Test262Error(); + } +}; +subject.lastIndex = 99; + +assert.throws(Test262Error, function() { + /./.compile('', badToString); +}); + +assert.throws(TypeError, function() { + /./.compile('', symbol); +}); + +assert.sameValue(subject.lastIndex, 99); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-to-string.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-to-string.js new file mode 100644 index 0000000000..7044462a56 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-to-string.js @@ -0,0 +1,41 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: Behavior when flags is a string describing a valid flag set +info: | + [...] + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + [...] + 3. If flags is undefined, let F be the empty String. + 4. Else, let F be ? ToString(flags). + [...] +---*/ + +var subject = /a/g; + +subject.compile('a', 'i'); + +assert.sameValue( + subject.flags, + new RegExp('a', 'i').flags, + '[[OriginalFlags]] internal slot' +); +assert.sameValue( + subject.test('A'), + true, + '[[RegExpMatcher]] internal slot (addition of `i` flag)' +); + +subject.lastIndex = 1; +assert.sameValue( + subject.test('A'), + true, + '[[RegExpMatcher]] internal slot (removal of `g` flag)' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-undefined.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-undefined.js new file mode 100644 index 0000000000..29cb3b3fb2 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/flags-undefined.js @@ -0,0 +1,54 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: Behavior when flags is undefined +info: | + [...] + 3. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal + slot, then + [...] + 4. Else, + a. Let P be pattern. + b. Let F be flags. + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + [...] + 3. If flags is undefined, let F be the empty String. + [...] +---*/ + +var subject, result; + +subject = /abc/ig; + +result = subject.compile('def'); + +assert.sameValue(result, subject, 'method return value (unspecified)'); +assert.sameValue( + subject.flags, new RegExp('def').flags, '[[OriginalFlags]] (unspecified)' +); +assert.sameValue( + subject.test('DEF'), false, '[[RegExpMatcher]] internal slot (unspecified)' +); + +subject = /abc/gi; + +result = subject.compile('def', undefined); + +assert.sameValue(result, subject, 'method return value (explicit undefined)'); +assert.sameValue( + subject.flags, + new RegExp('def').flags, + '[[OriginalSource]] (explicit undefined)' +); +assert.sameValue( + subject.test('DEF'), + false, + '[[RegExpMatcher]] internal slot (explicit undefined)' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/length.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/length.js new file mode 100644 index 0000000000..ce648e692c --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.5.1 +description: > + RegExp.prototype.compile.length is 2. +info: | + RegExp.prototype.compile (pattern, flags ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(RegExp.prototype.compile, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 2 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/name.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/name.js new file mode 100644 index 0000000000..2e35d280e3 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.5.1 +description: > + RegExp.prototype.compile.name is "compile". +info: | + RegExp.prototype.compile (pattern, flags ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(RegExp.prototype.compile, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "compile" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-distinct.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-distinct.js new file mode 100644 index 0000000000..fed4f82364 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-distinct.js @@ -0,0 +1,39 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: RegExp is re-initialized when invoked with a distinct instance +info: | + [...] + 3. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal + slot, then + a. If flags is not undefined, throw a TypeError exception. + b. Let P be the value of pattern's [[OriginalSource]] internal slot. + c. Let F be the value of pattern's [[OriginalFlags]] internal slot. + 4. Else, + [...] + 5. Return ? RegExpInitialize(O, P, F). +---*/ + +var subject = /abc/gim; +var pattern = /def/; +var result; +subject.lastIndex = 23; +pattern.lastIndex = 45; + +result = subject.compile(pattern); + +assert.sameValue(result, subject, 'method return value'); +assert.sameValue(subject.lastIndex, 0); +assert.sameValue(pattern.lastIndex, 45); + +assert.sameValue(subject.toString(), new RegExp('def').toString()); +assert.sameValue( + subject.test('def'), true, '[[RegExpMatcher]] internal slot (source)' +); +assert.sameValue( + subject.test('DEF'), false, '[[RegExpMatch]] internal slot (flags)' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-flags-defined.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-flags-defined.js new file mode 100644 index 0000000000..6ea536960c --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-flags-defined.js @@ -0,0 +1,46 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: > + Behavior when provided pattern is a RegExp instance and flags are specified +info: | + [...] + 3. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal + slot, then + a. If flags is not undefined, throw a TypeError exception. +---*/ + +var re = /./; +re.lastIndex = 23; + +assert.sameValue(typeof RegExp.prototype.compile, 'function'); + +assert.throws(TypeError, function() { + re.compile(re, null); +}, 'null'); + +assert.throws(TypeError, function() { + re.compile(re, 0); +}, 'numeric primitive'); + +assert.throws(TypeError, function() { + re.compile(re, ''); +}, 'string primitive'); + +assert.throws(TypeError, function() { + re.compile(re, false); +}, 'boolean primitive'); + +assert.throws(TypeError, function() { + re.compile(re, {}); +}, 'ordinary object'); + +assert.throws(TypeError, function() { + re.compile(re, []); +}, 'array exotic object'); + +assert.sameValue(re.lastIndex, 23); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-immutable-lastindex.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-immutable-lastindex.js new file mode 100644 index 0000000000..cb69aaa439 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-immutable-lastindex.js @@ -0,0 +1,38 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: Behavior when `lastIndex` property of "this" value is non-writable +info: | + [...] + 3. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal + slot, then + a. If flags is not undefined, throw a TypeError exception. + b. Let P be the value of pattern's [[OriginalSource]] internal slot. + c. Let F be the value of pattern's [[OriginalFlags]] internal slot. + 4. Else, + [...] + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + [...] + 12. Perform ? Set(obj, "lastIndex", 0, true). +---*/ + +var subject = /initial/; +Object.defineProperty(subject, 'lastIndex', { value: 45, writable: false }); + +assert.throws(TypeError, function() { + subject.compile(/updated/gi); +}); + +assert.sameValue( + subject.toString(), + new RegExp('updated', 'gi').toString(), + '[[OriginalSource]] internal slot' +); +assert.sameValue(subject.lastIndex, 45); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-props.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-props.js new file mode 100644 index 0000000000..f723c00174 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-props.js @@ -0,0 +1,75 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: > + Properties are not referenced when provided pattern is a RegExp instance +info: | + [...] + 3. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal + slot, then + a. If flags is not undefined, throw a TypeError exception. + b. Let P be the value of pattern's [[OriginalSource]] internal slot. + c. Let F be the value of pattern's [[OriginalFlags]] internal slot. + 4. Else, + [...] + 5. Return ? RegExpInitialize(O, P, F). +---*/ + +var thisValue = /abc/gim; +var pattern = /def/mig; +var flagsCount = 0; +var globalCount = 0; +var ignoreCaseCount = 0; +var multilineCount = 0; +var stickyCount = 0; +var unicodeCount = 0; +var counters = { + flags: { + get: function() { + flagsCount += 1; + } + }, + global: { + get: function() { + globalCount += 1; + } + }, + ignoreCase: { + get: function() { + ignoreCaseCount += 1; + } + }, + multiline: { + get: function() { + multilineCount += 1; + } + }, + sticky: { + get: function() { + stickyCount += 1; + } + }, + unicode: { + get: function() { + unicodeCount += 1; + } + } +}; + +Object.defineProperties(thisValue, counters); +Object.defineProperties(pattern, counters); + +thisValue.compile(thisValue); +thisValue.compile(pattern); +thisValue.compile(thisValue); + +assert.sameValue(flagsCount, 0, '`flags` property not accessed'); +assert.sameValue(globalCount, 0, '`global` property not accessed'); +assert.sameValue(ignoreCaseCount, 0, '`ignoreCase` property not accessed'); +assert.sameValue(multilineCount, 0, '`multiline` property not accessed'); +assert.sameValue(stickyCount, 0, '`sticky` property not accessed'); +assert.sameValue(unicodeCount, 0, '`unicode` property not accessed'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-same.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-same.js new file mode 100644 index 0000000000..b239e0e48b --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-regexp-same.js @@ -0,0 +1,34 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: RegExp is re-initialized when invoked with the same instance +info: | + [...] + 3. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal + slot, then + a. If flags is not undefined, throw a TypeError exception. + b. Let P be the value of pattern's [[OriginalSource]] internal slot. + c. Let F be the value of pattern's [[OriginalFlags]] internal slot. + 4. Else, + [...] + 5. Return ? RegExpInitialize(O, P, F). +---*/ + +var subject = /abc/gim; +var result; +subject.lastIndex = 23; + +result = subject.compile(subject); + +assert.sameValue(result, subject, 'method return value'); +assert.sameValue( + subject.toString(), + new RegExp('abc', 'gim').toString(), + '[[OriginalSource]] internal slot' +); +assert.sameValue(subject.lastIndex, 0); +assert.sameValue(subject.test('aBc'), true, '[[RegExpMatcher]] internal slot'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-invalid-u.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-invalid-u.js new file mode 100644 index 0000000000..d0c3cd6d5f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-invalid-u.js @@ -0,0 +1,44 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: > + Behavior when pattern is a string describing an invalid pattern (unicode) +info: | + [...] + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + 6. If F contains "u", let BMP be false; else let BMP be true. + 7. If BMP is true, then + a. Parse P using the grammars in 21.2.1 and interpreting each of its + 16-bit elements as a Unicode BMP code point. UTF-16 decoding is not + applied to the elements. The goal symbol for the parse is Pattern. + Throw a SyntaxError exception if P did not conform to the grammar, if + any elements of P were not matched by the parse, or if any Early + Error conditions exist. + [...] +---*/ + +var subject = /test262/ig; + +assert.throws(SyntaxError, function() { + subject.compile('{', 'u'); +}, 'invalid pattern: {'); + +assert.throws(SyntaxError, function() { + subject.compile('\\2', 'u'); +}, 'invalid pattern: \\2'); + +assert.sameValue( + subject.toString(), + new RegExp('test262', 'ig').toString(), + '[[OriginalSource]] internal slot' +); +assert.sameValue( + subject.test('tEsT262'), true, '[[RegExpMatcher]] internal slot' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-invalid.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-invalid.js new file mode 100644 index 0000000000..471e8da688 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-invalid.js @@ -0,0 +1,46 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: > + Behavior when pattern is a string describing an invalid pattern + (non-unicode) +info: | + [...] + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + 6. If F contains "u", let BMP be false; else let BMP be true. + 7. If BMP is true, then + [...] + 8. Else, + a. Parse P using the grammars in 21.2.1 and interpreting P as UTF-16 + encoded Unicode code points (6.1.4). The goal symbol for the parse is + Pattern[U]. Throw a SyntaxError exception if P did not conform to the + grammar, if any elements of P were not matched by the parse, or if + any Early Error conditions exist. +---*/ + +var subject = /test262/ig; + +assert.throws(SyntaxError, function() { + subject.compile('?'); +}, 'invalid pattern: ?'); + +assert.throws(SyntaxError, function() { + subject.compile('.{2,1}'); +}, 'invalid pattern: .{2,1}'); + +assert.sameValue( + subject.toString(), + new RegExp('test262', 'ig').toString(), + '[[OriginalSource]] internal slot' +); + +assert.sameValue( + subject.test('TEsT262'), true, '[[RegExpMatcher]] internal slot' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-u.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-u.js new file mode 100644 index 0000000000..e3840230fb --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string-u.js @@ -0,0 +1,53 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: > + Behavior when pattern is a string describing a valid pattern (unicode) +info: | + [...] + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + 6. If F contains "u", let BMP be false; else let BMP be true. + 7. If BMP is true, then + a. Parse P using the grammars in 21.2.1 and interpreting each of its + 16-bit elements as a Unicode BMP code point. UTF-16 decoding is not + applied to the elements. The goal symbol for the parse is Pattern. + Throw a SyntaxError exception if P did not conform to the grammar, if + any elements of P were not matched by the parse, or if any Early + Error conditions exist. + b. Let patternCharacters be a List whose elements are the code unit + elements of P. + [...] +---*/ + +var subject = /original value/ig; + +subject.compile('[\ud834\udf06]', 'u'); + +assert.sameValue( + subject.source, + new RegExp('[\ud834\udf06]', 'u').source, + '[[OriginalSource]] internal slot' +); +assert.sameValue( + subject.test('original value'), + false, + '[[RegExpMatcher]] internal slot (source)' +); +assert.sameValue( + subject.test('\ud834'), false, '[[RegExpMatcher]] internal slot (flags #1)' +); +assert.sameValue( + subject.test('\udf06'), false, '[[RegExpMatcher]] internal slot (flags #2)' +); +assert.sameValue( + subject.test('\ud834\udf06'), + true, + '[[RegExpMatcher]] internal slot (flags #3)' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string.js new file mode 100644 index 0000000000..57c9a82e41 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-string.js @@ -0,0 +1,44 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: > + Behavior when pattern is a string describing a valid pattern (non-unicode) +info: | + [...] + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + 6. If F contains "u", let BMP be false; else let BMP be true. + 7. If BMP is true, then + [...] + 8. Else, + a. Parse P using the grammars in 21.2.1 and interpreting P as UTF-16 + encoded Unicode code points (6.1.4). The goal symbol for the parse is + Pattern[U]. Throw a SyntaxError exception if P did not conform to the + grammar, if any elements of P were not matched by the parse, or if + any Early Error conditions exist. + b. Let patternCharacters be a List whose elements are the code points + resulting from applying UTF-16 decoding to P's sequence of elements. + [...] +---*/ + +var subject = /original value/ig; + +subject.compile('new value'); + +assert.sameValue( + subject.source, + new RegExp('new value').source, + '[[OriginalSource]] internal slot' +); +assert.sameValue( + subject.test('original value'), false, '[[RegExpMatcher]] internal slot' +); +assert.sameValue( + subject.test('new value'), true, '[[RegExpMatcher]] internal slot' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-to-string-err.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-to-string-err.js new file mode 100644 index 0000000000..64df03654a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-to-string-err.js @@ -0,0 +1,44 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: Behavior when provided pattern cannot be coerced to a string +info: | + [...] + 3. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal + slot, then + a. If flags is not undefined, throw a TypeError exception. + b. Let P be the value of pattern's [[OriginalSource]] internal slot. + c. Let F be the value of pattern's [[OriginalFlags]] internal slot. + 4. Else, + [...] + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + 1. If pattern is undefined, let P be the empty String. + 2. Else, let P be ? ToString(pattern). +features: [Symbol] +---*/ + +var symbol = Symbol(''); +var subject = /./; +var badToString = { + toString: function() { + throw new Test262Error(); + } +}; +subject.lastIndex = 99; + +assert.throws(Test262Error, function() { + /./.compile(badToString); +}); + +assert.throws(TypeError, function() { + /./.compile(symbol); +}); + +assert.sameValue(subject.lastIndex, 99); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-undefined.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-undefined.js new file mode 100644 index 0000000000..52328d262d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/pattern-undefined.js @@ -0,0 +1,53 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: Behavior when pattern is undefined +info: | + [...] + 3. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal + slot, then + [...] + 4. Else, + a. Let P be pattern. + b. Let F be flags. + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.3.2.2 Runtime Semantics: RegExpInitialize + + 1. If pattern is undefined, let P be the empty String. + [...] +---*/ + +var subject; + +subject = /abc/; +assert.sameValue( + subject.compile(), subject, 'method return value (unspecified)' +); +assert.sameValue( + subject.source, new RegExp('').source, '[[OriginalSource]] (unspecified)' +); +assert.sameValue( + subject.test(''), true, '[[RegExpMatcher]] internal slot (unspecified)' +); + +subject = /abc/; +assert.sameValue( + subject.compile(undefined), + subject, + 'method return value (explicit undefined)' +); +assert.sameValue( + subject.source, + new RegExp('').source, + '[[OriginalSource]] (explicit undefined)' +); +assert.sameValue( + subject.test(''), + true, + '[[RegExpMatcher]] internal slot (explicit undefined)' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-cross-realm-instance.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-cross-realm-instance.js new file mode 100644 index 0000000000..5c4f9a8234 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-cross-realm-instance.js @@ -0,0 +1,37 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +description: RegExp.prototype.compile throws a TypeError for cross-realm calls +features: [legacy-regexp,cross-realm] +---*/ + +const other = $262.createRealm().global; + +const regexp = new RegExp(""); +const otherRealm_regexp = new other.RegExp(""); + +assert.throws( + TypeError, + function () { + RegExp.prototype.compile.call(otherRealm_regexp); + }, + "`RegExp.prototype.compile.call(otherRealm_regexp)` throws TypeError" +); + +assert.throws( + other.TypeError, + function () { + other.RegExp.prototype.compile.call(regexp); + }, + "`other.RegExp.prototype.compile.call(regexp)` throws TypeError" +); + +assert.sameValue( + otherRealm_regexp.compile(), + otherRealm_regexp, + "`otherRealm_regexp.compile()` is SameValue with `otherRealm_regexp`" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-not-object.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-not-object.js new file mode 100644 index 0000000000..77424a0062 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-not-object.js @@ -0,0 +1,44 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: Behavior when "this" value is not an Object +info: | + 1. Let O be the this value. + 2. If Type(O) is not Object or Type(O) is Object and O does not have a + [[RegExpMatcher]] internal slot, then + a. Throw a TypeError exception. +features: [Symbol] +---*/ + +var compile = RegExp.prototype.compile; +var symbol = Symbol(''); + +assert.sameValue(typeof compile, 'function'); + +assert.throws(TypeError, function() { + compile.call(undefined); +}, 'undefined'); + +assert.throws(TypeError, function() { + compile.call(null); +}, 'null'); + +assert.throws(TypeError, function() { + compile.call(23); +}, 'number'); + +assert.throws(TypeError, function() { + compile.call(true); +}, 'boolean'); + +assert.throws(TypeError, function() { + compile.call('/string/'); +}, 'string'); + +assert.throws(TypeError, function() { + compile.call(symbol); +}, 'symbol'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-obj-not-regexp.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-obj-not-regexp.js new file mode 100644 index 0000000000..785fccacff --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-obj-not-regexp.js @@ -0,0 +1,32 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +es6id: B.2.5.1 +description: > + Behavior when "this" value is an Object without a [[RegExpMatcher]] + internal slot +info: | + 1. Let O be the this value. + 2. If Type(O) is not Object or Type(O) is Object and O does not have a + [[RegExpMatcher]] internal slot, then + a. Throw a TypeError exception. +---*/ + +var compile = RegExp.prototype.compile; + +assert.sameValue(typeof compile, 'function'); + +assert.throws(TypeError, function() { + compile.call({}); +}, 'ordinary object'); + +assert.throws(TypeError, function() { + compile.call([]); +}, 'array exotic object'); + +assert.throws(TypeError, function() { + compile.call(arguments); +}, 'arguments exotic object'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-subclass-instance.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-subclass-instance.js new file mode 100644 index 0000000000..66f6e3f5a6 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/compile/this-subclass-instance.js @@ -0,0 +1,28 @@ +// |reftest| skip -- legacy-regexp is not supported +// Copyright (C) 2020 ExE Boss. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-regexp.prototype.compile +description: RegExp.prototype.compile throws a TypeError for calls on subclasses +features: [legacy-regexp,class] +---*/ + +const subclass_regexp = new (class extends RegExp {})(""); + +assert.throws( + TypeError, + function () { + subclass_regexp.compile(); + }, + "`subclass_regexp.compile()` throws TypeError" +); + +assert.throws( + TypeError, + function () { + RegExp.prototype.compile.call(subclass_regexp); + }, + "`RegExp.prototype.compile.call(subclass_regexp)` throws TypeError" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/flags/browser.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/flags/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/flags/order-after-compile.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/flags/order-after-compile.js new file mode 100644 index 0000000000..c445800923 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/flags/order-after-compile.js @@ -0,0 +1,37 @@ +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-get-regexp.prototype.flags +description: > + The flags come in the same order in a new instance produced by RegExp.prototype.compile +info: | + B.2.5.1 RegExp.prototype.compile ( pattern, flags ) + + ... + 5. Return ? RegExpInitialize(O, P, F). + + 21.2.5.3 get RegExp.prototype.flags + + ... + 4. Let global be ToBoolean(? Get(R, "global")). + 5. If global is true, append "g" as the last code unit of result. + 6. Let ignoreCase be ToBoolean(? Get(R, "ignoreCase")). + 7. If ignoreCase is true, append "i" as the last code unit of result. + 8. Let multiline be ToBoolean(? Get(R, "multiline")). + 9. If multiline is true, append "m" as the last code unit of result. + 10. Let dotAll be ToBoolean(? Get(R, "dotAll")). + 11. If dotAll is true, append "s" as the last code unit of result. + 12. Let unicode be ToBoolean(? Get(R, "unicode")). + 13. If unicode is true, append "u" as the last code unit of result. + 14. Let sticky be ToBoolean(? Get(R, "sticky")). + 15. If sticky is true, append "y" as the last code unit of result. + 14. Return result. +features: [regexp-dotall] +---*/ + +let re = /(?:)/; +re.compile("(?:)", "imsuyg"); +assert.sameValue(re.flags, "gimsuy"); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/flags/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/flags/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/prototype/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/prototype/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/shell.js b/js/src/tests/test262/annexB/built-ins/RegExp/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/browser.js b/js/src/tests/test262/annexB/built-ins/String/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/B.2.3.2.js b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/B.2.3.2.js new file mode 100644 index 0000000000..6b8511876e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/B.2.3.2.js @@ -0,0 +1,28 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.anchor returns a string of HTML describing a single HTML + anchor element. The element's content is the `this` value of the function + invocation, coerced to a string. If specified, the first argument will be + coerced to a string, escaped, and set as the element's `name` attribute. + es6id: B.2.3.2 +---*/ + +assert.sameValue('_'.anchor('b'), '_'); +assert.sameValue('<'.anchor('<'), '<'); +assert.sameValue('_'.anchor(0x2A), '_'); +assert.sameValue('_'.anchor('\x22'), '_'); +assert.sameValue(String.prototype.anchor.call(0x2A, 0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.anchor.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.anchor.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/attr-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/attr-tostring-err.js new file mode 100644 index 0000000000..bf6a3eae21 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/attr-tostring-err.js @@ -0,0 +1,25 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.anchor +es6id: B.2.3.2 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + [...] + 4. If attribute is not the empty String, then + a. Let V be ? ToString(value). +---*/ + +var attr = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + ''.anchor(attr); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/length.js new file mode 100644 index 0000000000..9df190d4a3 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.2 +description: > + String.prototype.anchor.length is 1. +info: | + String.prototype.anchor ( name ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.anchor, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 1 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/name.js new file mode 100644 index 0000000000..4d961bd1a9 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.2 +description: > + String.prototype.anchor.name is "anchor". +info: | + String.prototype.anchor ( name ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.anchor, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "anchor" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/not-a-constructor.js new file mode 100644 index 0000000000..ca59226cbf --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.anchor does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.anchor), + false, + 'isConstructor(String.prototype.anchor) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.anchor(); +}, '`new String.prototype.anchor()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/prop-desc.js new file mode 100644 index 0000000000..b1412c4a1c --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.anchor +es6id: B.2.3.2 +description: Property descriptor for String.prototype.anchor +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "anchor", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/this-val-tostring-err.js new file mode 100644 index 0000000000..c6d9d25d41 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/anchor/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.anchor +es6id: B.2.3.2 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.anchor.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/big/B.2.3.3.js b/js/src/tests/test262/annexB/built-ins/String/prototype/big/B.2.3.3.js new file mode 100644 index 0000000000..16a179283f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/big/B.2.3.3.js @@ -0,0 +1,25 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.big returns a string of HTML describing a single HTML + big element. The element's content is the `this` value of the function + invocation, coerced to a string. + es6id: B.2.3.3 +---*/ + +assert.sameValue('_'.big(), '_'); +assert.sameValue('<'.big(), '<'); +assert.sameValue(String.prototype.big.call(0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.big.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.big.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/big/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/big/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/big/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/big/length.js new file mode 100644 index 0000000000..bc94e5fdc4 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/big/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.3 +description: > + String.prototype.big.length is 0. +info: | + String.prototype.big ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.big, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 0 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/big/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/big/name.js new file mode 100644 index 0000000000..29dad81234 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/big/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.3 +description: > + String.prototype.big.name is "big". +info: | + String.prototype.big ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.big, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "big" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/big/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/big/not-a-constructor.js new file mode 100644 index 0000000000..f2e5f3bfc7 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/big/not-a-constructor.js @@ -0,0 +1,30 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.big does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(String.prototype.big), false, 'isConstructor(String.prototype.big) must return false'); + +assert.throws(TypeError, () => { + new String.prototype.big(); +}, '`new String.prototype.big()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/big/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/big/prop-desc.js new file mode 100644 index 0000000000..80a2b7ef72 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/big/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.big +es6id: B.2.3.3 +description: Property descriptor for String.prototype.big +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "big", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/big/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/big/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/big/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/big/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/big/this-val-tostring-err.js new file mode 100644 index 0000000000..63326e834a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/big/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.big +es6id: B.2.3.3 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.big.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/blink/B.2.3.4.js b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/B.2.3.4.js new file mode 100644 index 0000000000..5aa5620c82 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/B.2.3.4.js @@ -0,0 +1,25 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.blink returns a string of HTML describing a single HTML + blink element. The element's content is the `this` value of the function + invocation, coerced to a string. + es6id: B.2.3.4 +---*/ + +assert.sameValue('_'.blink(), '_'); +assert.sameValue('<'.blink(), '<'); +assert.sameValue(String.prototype.blink.call(0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.blink.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.blink.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/blink/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/blink/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/length.js new file mode 100644 index 0000000000..06c85b49dc --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.4 +description: > + String.prototype.blink.length is 0. +info: | + String.prototype.blink ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.blink, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 0 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/blink/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/name.js new file mode 100644 index 0000000000..617b2d6993 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.4 +description: > + String.prototype.blink.name is "blink". +info: | + String.prototype.blink ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.blink, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "blink" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/blink/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/not-a-constructor.js new file mode 100644 index 0000000000..73d5488203 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.blink does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.blink), + false, + 'isConstructor(String.prototype.blink) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.blink(); +}, '`new String.prototype.blink()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/blink/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/prop-desc.js new file mode 100644 index 0000000000..8c875db468 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.blink +es6id: B.2.3.4 +description: Property descriptor for String.prototype.blink +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "blink", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/blink/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/blink/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/this-val-tostring-err.js new file mode 100644 index 0000000000..4a2f900e23 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/blink/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.blink +es6id: B.2.3.4 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.blink.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/bold/B.2.3.5.js b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/B.2.3.5.js new file mode 100644 index 0000000000..3a9a73052e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/B.2.3.5.js @@ -0,0 +1,25 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.bold returns a string of HTML describing a single HTML + bold element. The element's content is the `this` value of the function + invocation, coerced to a string. + es6id: B.2.3.5 +---*/ + +assert.sameValue('_'.bold(), '_'); +assert.sameValue('<'.bold(), '<'); +assert.sameValue(String.prototype.bold.call(0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.bold.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.bold.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/bold/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/bold/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/length.js new file mode 100644 index 0000000000..151964b7ec --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.5 +description: > + String.prototype.bold.length is 0. +info: | + String.prototype.bold ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.bold, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 0 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/bold/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/name.js new file mode 100644 index 0000000000..21c7beafd0 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.5 +description: > + String.prototype.bold.name is "bold". +info: | + String.prototype.bold ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.bold, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "bold" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/bold/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/not-a-constructor.js new file mode 100644 index 0000000000..1f8a7a155d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.bold does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.bold), + false, + 'isConstructor(String.prototype.bold) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.bold(); +}, '`new String.prototype.bold()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/bold/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/prop-desc.js new file mode 100644 index 0000000000..1eb27ef8bc --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.bold +es6id: B.2.3.5 +description: Property descriptor for String.prototype.bold +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "bold", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/bold/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/bold/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/this-val-tostring-err.js new file mode 100644 index 0000000000..7f1fdd05ec --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/bold/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.bold +es6id: B.2.3.5 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.bold.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/B.2.3.6.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/B.2.3.6.js new file mode 100644 index 0000000000..2c20e91f4c --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/B.2.3.6.js @@ -0,0 +1,25 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.fixed returns a string of HTML describing a single HTML + teletype text element. The element's content is the `this` value of the + function invocation, coerced to a string. + es6id: B.2.3.6 +---*/ + +assert.sameValue('_'.fixed(), '_'); +assert.sameValue('<'.fixed(), '<'); +assert.sameValue(String.prototype.fixed.call(0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.fixed.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.fixed.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/length.js new file mode 100644 index 0000000000..bc2d83974b --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.6 +description: > + String.prototype.fixed.length is 0. +info: | + String.prototype.fixed ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.fixed, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 0 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/name.js new file mode 100644 index 0000000000..a5b546cd76 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.6 +description: > + String.prototype.fixed.name is "fixed". +info: | + String.prototype.fixed ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.fixed, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "fixed" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/not-a-constructor.js new file mode 100644 index 0000000000..64fa0c534d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.fixed does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.fixed), + false, + 'isConstructor(String.prototype.fixed) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.fixed(); +}, '`new String.prototype.fixed()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/prop-desc.js new file mode 100644 index 0000000000..c6691e668b --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.fixed +es6id: B.2.3.6 +description: Property descriptor for String.prototype.fixed +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "fixed", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/this-val-tostring-err.js new file mode 100644 index 0000000000..96b339a0f0 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fixed/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.fixed +es6id: B.2.3.6 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.fixed.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/B.2.3.7.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/B.2.3.7.js new file mode 100644 index 0000000000..497e24654d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/B.2.3.7.js @@ -0,0 +1,30 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.fontcolor returns a string of HTML describing a single + HTML font element. The element's content is the `this` value of the + function invocation, coerced to a string. If specified, the first argument + will be coerced to a string, escaped, and set as the element's `color` + attribute. + es6id: B.2.3.7 +---*/ + +assert.sameValue('_'.fontcolor('b'), '_'); +assert.sameValue('<'.fontcolor('<'), '<'); +assert.sameValue('_'.fontcolor(0x2A), '_'); +assert.sameValue('_'.fontcolor('\x22'), '_'); +assert.sameValue(String.prototype.fontcolor.call(0x2A, 0x2A), + '42'); +assert.throws(TypeError, function() { + String.prototype.fontcolor.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.fontcolor.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/attr-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/attr-tostring-err.js new file mode 100644 index 0000000000..bc4604f7b9 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/attr-tostring-err.js @@ -0,0 +1,25 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.fontcolor +es6id: B.2.3.7 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + [...] + 4. If attribute is not the empty String, then + a. Let V be ? ToString(value). +---*/ + +var attr = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + ''.fontcolor(attr); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/length.js new file mode 100644 index 0000000000..d12fa78837 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.7 +description: > + String.prototype.fontcolor.length is 1. +info: | + String.prototype.fontcolor ( color ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.fontcolor, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 1 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/name.js new file mode 100644 index 0000000000..237ce1debc --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.7 +description: > + String.prototype.fontcolor.name is "fontcolor". +info: | + String.prototype.fontcolor ( color ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.fontcolor, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "fontcolor" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js new file mode 100644 index 0000000000..a5bfa4415c --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.fontcolor does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.fontcolor), + false, + 'isConstructor(String.prototype.fontcolor) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.fontcolor(); +}, '`new String.prototype.fontcolor()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/prop-desc.js new file mode 100644 index 0000000000..0473c209ce --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.fontcolor +es6id: B.2.3.7 +description: Property descriptor for String.prototype.fontcolor +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "fontcolor", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/this-val-tostring-err.js new file mode 100644 index 0000000000..2fdacd804b --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontcolor/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.fontcolor +es6id: B.2.3.7 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.fontcolor.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/B.2.3.8.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/B.2.3.8.js new file mode 100644 index 0000000000..b6f51d9f3b --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/B.2.3.8.js @@ -0,0 +1,30 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.fontsize returns a string of HTML describing a single + HTML font element. The element's content is the `this` value of the + function invocation, coerced to a string. If specified, the first argument + will be coerced to a string, escaped, and set as the element's `size` + attribute. + es6id: B.2.3.8 +---*/ + +assert.sameValue('_'.fontsize('b'), '_'); +assert.sameValue('<'.fontsize('<'), '<'); +assert.sameValue('_'.fontsize(0x2A), '_'); +assert.sameValue('_'.fontsize('\x22'), '_'); +assert.sameValue(String.prototype.fontsize.call(0x2A, 0x2A), + '42'); +assert.throws(TypeError, function() { + String.prototype.fontsize.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.fontsize.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/attr-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/attr-tostring-err.js new file mode 100644 index 0000000000..be60430f40 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/attr-tostring-err.js @@ -0,0 +1,25 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.fontsize +es6id: B.2.3.8 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + [...] + 4. If attribute is not the empty String, then + a. Let V be ? ToString(value). +---*/ + +var attr = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + ''.fontsize(attr); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/length.js new file mode 100644 index 0000000000..94cf9e7f4e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.8 +description: > + String.prototype.fontsize.length is 1. +info: | + String.prototype.fontsize ( size ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.fontsize, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 1 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/name.js new file mode 100644 index 0000000000..42d7b00105 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.8 +description: > + String.prototype.fontsize.name is "fontsize". +info: | + String.prototype.fontsize ( color ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.fontsize, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "fontsize" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js new file mode 100644 index 0000000000..d221a1348a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.fontsize does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.fontsize), + false, + 'isConstructor(String.prototype.fontsize) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.fontsize(); +}, '`new String.prototype.fontsize()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/prop-desc.js new file mode 100644 index 0000000000..d25aceb2e8 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.fontsize +es6id: B.2.3.8 +description: Property descriptor for String.prototype.fontsize +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "fontsize", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/this-val-tostring-err.js new file mode 100644 index 0000000000..9bb7b11da6 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/fontsize/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.fontsize +es6id: B.2.3.8 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.fontsize.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/italics/B.2.3.9.js b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/B.2.3.9.js new file mode 100644 index 0000000000..5421037edb --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/B.2.3.9.js @@ -0,0 +1,25 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.italics returns a string of HTML describing a single HTML + italic element. The element's content is the `this` value of the function + invocation, coerced to a string. + es6id: B.2.3.9 +---*/ + +assert.sameValue('_'.italics(), '_'); +assert.sameValue('<'.italics(), '<'); +assert.sameValue(String.prototype.italics.call(0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.italics.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.italics.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/italics/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/italics/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/length.js new file mode 100644 index 0000000000..1c2a517ffa --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.9 +description: > + String.prototype.italics.length is 0. +info: | + String.prototype.italics ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.italics, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 0 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/italics/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/name.js new file mode 100644 index 0000000000..56139bf62b --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.9 +description: > + String.prototype.italics.name is "italics". +info: | + String.prototype.italics ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.italics, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "italics" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/italics/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/not-a-constructor.js new file mode 100644 index 0000000000..4833d9b0e5 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.italics does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.italics), + false, + 'isConstructor(String.prototype.italics) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.italics(); +}, '`new String.prototype.italics()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/italics/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/prop-desc.js new file mode 100644 index 0000000000..041b5ad7f4 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.italics +es6id: B.2.3.9 +description: Property descriptor for String.prototype.italics +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "italics", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/italics/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/italics/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/this-val-tostring-err.js new file mode 100644 index 0000000000..db693918dd --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/italics/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.italics +es6id: B.2.3.9 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.italics.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/link/B.2.3.10.js b/js/src/tests/test262/annexB/built-ins/String/prototype/link/B.2.3.10.js new file mode 100644 index 0000000000..01d0268cdd --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/link/B.2.3.10.js @@ -0,0 +1,28 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.link returns a string of HTML describing a single HTML + link element. The element's content is the `this` value of the function + invocation, coerced to a string. If specified, the first argument will be + coerced to a string, escaped, and set as the element's `href` attribute. + es6id: B.2.3.10 +---*/ + +assert.sameValue('_'.link('b'), '_'); +assert.sameValue('<'.link('<'), '<'); +assert.sameValue('_'.link(0x2A), '_'); +assert.sameValue('_'.link('\x22'), '_'); +assert.sameValue(String.prototype.link.call(0x2A, 0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.link.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.link.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/link/attr-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/link/attr-tostring-err.js new file mode 100644 index 0000000000..88b6d3e301 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/link/attr-tostring-err.js @@ -0,0 +1,25 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.link +es6id: B.2.3.10 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + [...] + 4. If attribute is not the empty String, then + a. Let V be ? ToString(value). +---*/ + +var attr = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + ''.link(attr); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/link/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/link/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/link/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/link/length.js new file mode 100644 index 0000000000..f51904e982 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/link/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.10 +description: > + String.prototype.link.length is 1. +info: | + String.prototype.link ( url ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.link, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 1 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/link/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/link/name.js new file mode 100644 index 0000000000..fb7ea3ee2a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/link/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.10 +description: > + String.prototype.link.name is "link". +info: | + String.prototype.link ( url ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.link, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "link" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/link/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/link/not-a-constructor.js new file mode 100644 index 0000000000..afd8d81733 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/link/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.link does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.link), + false, + 'isConstructor(String.prototype.link) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.link(); +}, '`new String.prototype.link()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/link/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/link/prop-desc.js new file mode 100644 index 0000000000..75bf7df731 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/link/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.link +es6id: B.2.3.10 +description: Property descriptor for String.prototype.link +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "link", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/link/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/link/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/link/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/link/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/link/this-val-tostring-err.js new file mode 100644 index 0000000000..b14c932f59 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/link/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.link +es6id: B.2.3.10 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.link.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/match/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/match/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/match/custom-matcher-emulates-undefined.js b/js/src/tests/test262/annexB/built-ins/String/prototype/match/custom-matcher-emulates-undefined.js new file mode 100644 index 0000000000..55e6d28feb --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/match/custom-matcher-emulates-undefined.js @@ -0,0 +1,31 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.match +description: > + [[IsHTMLDDA]] object as @@match method gets called. +info: | + String.prototype.match ( regexp ) + + [...] + 2. If regexp is neither undefined nor null, then + a. Let matcher be ? GetMethod(regexp, @@match). + b. If matcher is not undefined, then + i. Return ? Call(matcher, regexp, « O »). +features: [Symbol.match, IsHTMLDDA] +---*/ + +var regexp = $262.IsHTMLDDA; +var matcherGets = 0; +Object.defineProperty(regexp, Symbol.match, { + get: function() { + matcherGets += 1; + return regexp; + }, + configurable: true, +}); + +assert.sameValue("".match(regexp), null); +assert.sameValue(matcherGets, 1); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/match/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/match/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/matchAll/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/matchAll/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/matchAll/custom-matcher-emulates-undefined.js b/js/src/tests/test262/annexB/built-ins/String/prototype/matchAll/custom-matcher-emulates-undefined.js new file mode 100644 index 0000000000..5abb9d10d3 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/matchAll/custom-matcher-emulates-undefined.js @@ -0,0 +1,32 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.matchall +description: > + [[IsHTMLDDA]] object as @@matchAll method gets called. +info: | + String.prototype.matchAll ( regexp ) + + [...] + 2. If regexp is neither undefined nor null, then + [...] + c. Let matcher be ? GetMethod(regexp, @@matchAll). + d. If matcher is not undefined, then + i. Return ? Call(matcher, regexp, « O »). +features: [Symbol.matchAll, String.prototype.matchAll, IsHTMLDDA] +---*/ + +var regexp = $262.IsHTMLDDA; +var matcherGets = 0; +Object.defineProperty(regexp, Symbol.matchAll, { + get: function() { + matcherGets += 1; + return regexp; + }, + configurable: true, +}); + +assert.sameValue("".matchAll(regexp), null); +assert.sameValue(matcherGets, 1); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/matchAll/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/matchAll/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/replace/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/replace/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/replace/custom-replacer-emulates-undefined.js b/js/src/tests/test262/annexB/built-ins/String/prototype/replace/custom-replacer-emulates-undefined.js new file mode 100644 index 0000000000..07c5ad606f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/replace/custom-replacer-emulates-undefined.js @@ -0,0 +1,31 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.replace +description: > + [[IsHTMLDDA]] object as @@replace method gets called. +info: | + String.prototype.replace ( searchValue, replaceValue ) + + [...] + 2. If searchValue is neither undefined nor null, then + a. Let replacer be ? GetMethod(searchValue, @@replace). + b. If replacer is not undefined, then + i. Return ? Call(replacer, searchValue, « O, replaceValue »). +features: [Symbol.replace, IsHTMLDDA] +---*/ + +var searchValue = $262.IsHTMLDDA; +var replacerGets = 0; +Object.defineProperty(searchValue, Symbol.replace, { + get: function() { + replacerGets += 1; + return searchValue; + }, + configurable: true, +}); + +assert.sameValue("".replace(searchValue), null); +assert.sameValue(replacerGets, 1); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/replace/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/replace/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/replaceAll/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/replaceAll/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/replaceAll/custom-replacer-emulates-undefined.js b/js/src/tests/test262/annexB/built-ins/String/prototype/replaceAll/custom-replacer-emulates-undefined.js new file mode 100644 index 0000000000..7fec73440a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/replaceAll/custom-replacer-emulates-undefined.js @@ -0,0 +1,32 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.replaceall +description: > + [[IsHTMLDDA]] object as @@replace method gets called. +info: | + String.prototype.replaceAll ( searchValue, replaceValue ) + + [...] + 2. If searchValue is neither undefined nor null, then + [...] + c. Let replacer be ? GetMethod(searchValue, @@replace). + d. If replacer is not undefined, then + i. Return ? Call(replacer, searchValue, « O, replaceValue »). +features: [Symbol.replace, String.prototype.replaceAll, IsHTMLDDA] +---*/ + +var searchValue = $262.IsHTMLDDA; +var replacerGets = 0; +Object.defineProperty(searchValue, Symbol.replace, { + get: function() { + replacerGets += 1; + return searchValue; + }, + configurable: true, +}); + +assert.sameValue("".replaceAll(searchValue), null); +assert.sameValue(replacerGets, 1); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/replaceAll/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/replaceAll/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/search/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/search/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/search/custom-searcher-emulates-undefined.js b/js/src/tests/test262/annexB/built-ins/String/prototype/search/custom-searcher-emulates-undefined.js new file mode 100644 index 0000000000..d96bbb1ff7 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/search/custom-searcher-emulates-undefined.js @@ -0,0 +1,31 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.search +description: > + [[IsHTMLDDA]] object as @@search method gets called. +info: | + String.prototype.search ( regexp ) + + [...] + 2. If regexp is neither undefined nor null, then + a. Let searcher be ? GetMethod(regexp, @@search). + b. If searcher is not undefined, then + i. Return ? Call(searcher, regexp, « O »). +features: [Symbol.search, IsHTMLDDA] +---*/ + +var regexp = $262.IsHTMLDDA; +var searcherGets = 0; +Object.defineProperty(regexp, Symbol.search, { + get: function() { + searcherGets += 1; + return regexp; + }, + configurable: true, +}); + +assert.sameValue("".search(regexp), null); +assert.sameValue(searcherGets, 1); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/search/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/search/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/small/B.2.3.11.js b/js/src/tests/test262/annexB/built-ins/String/prototype/small/B.2.3.11.js new file mode 100644 index 0000000000..52274f8b0a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/small/B.2.3.11.js @@ -0,0 +1,25 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.small returns a string of HTML describing a single HTML + small print element. The element's content is the `this` value of the + function invocation, coerced to a string. + es6id: B.2.3.11 +---*/ + +assert.sameValue('_'.small(), '_'); +assert.sameValue('<'.small(), '<'); +assert.sameValue(String.prototype.small.call(0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.small.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.small.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/small/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/small/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/small/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/small/length.js new file mode 100644 index 0000000000..0809743f95 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/small/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.11 +description: > + String.prototype.small.length is 0. +info: | + String.prototype.small ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.small, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 0 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/small/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/small/name.js new file mode 100644 index 0000000000..cc439add06 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/small/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.11 +description: > + String.prototype.small.name is "small". +info: | + String.prototype.small ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.small, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "small" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/small/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/small/not-a-constructor.js new file mode 100644 index 0000000000..a0a9aa6090 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/small/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.small does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.small), + false, + 'isConstructor(String.prototype.small) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.small(); +}, '`new String.prototype.small()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/small/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/small/prop-desc.js new file mode 100644 index 0000000000..631b31349d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/small/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.small +es6id: B.2.3.11 +description: Property descriptor for String.prototype.small +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "small", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/small/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/small/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/small/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/small/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/small/this-val-tostring-err.js new file mode 100644 index 0000000000..b546cc6ea7 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/small/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.small +es6id: B.2.3.11 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.small.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/split/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/split/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/split/custom-splitter-emulates-undefined.js b/js/src/tests/test262/annexB/built-ins/String/prototype/split/custom-splitter-emulates-undefined.js new file mode 100644 index 0000000000..fe120958cd --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/split/custom-splitter-emulates-undefined.js @@ -0,0 +1,31 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.split +description: > + [[IsHTMLDDA]] object as @@split method gets called. +info: | + String.prototype.split ( separator, limit ) + + [...] + 2. If separator is neither undefined nor null, then + a. Let splitter be ? GetMethod(separator, @@split). + b. If splitter is not undefined, then + i. Return ? Call(splitter, separator, « O, limit »). +features: [Symbol.split, IsHTMLDDA] +---*/ + +var separator = $262.IsHTMLDDA; +var splitterGets = 0; +Object.defineProperty(separator, Symbol.split, { + get: function() { + splitterGets += 1; + return separator; + }, + configurable: true, +}); + +assert.sameValue("".split(separator), null); +assert.sameValue(splitterGets, 1); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/split/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/split/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/strike/B.2.3.12.js b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/B.2.3.12.js new file mode 100644 index 0000000000..7fef1de75d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/B.2.3.12.js @@ -0,0 +1,25 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.strike returns a string of HTML describing a single HTML + strikethrough element. The element's content is the `this` value of the + function invocation, coerced to a string. + es6id: B.2.3.12 +---*/ + +assert.sameValue('_'.strike(), '_'); +assert.sameValue('<'.strike(), '<'); +assert.sameValue(String.prototype.strike.call(0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.strike.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.strike.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/strike/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/strike/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/length.js new file mode 100644 index 0000000000..7fc3ac2ff0 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.12 +description: > + String.prototype.strike.length is 0. +info: | + String.prototype.strike ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.strike, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 0 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/strike/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/name.js new file mode 100644 index 0000000000..ed8b2cc4d9 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.12 +description: > + String.prototype.strike.name is "strike". +info: | + String.prototype.strike ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.strike, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "strike" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/strike/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/not-a-constructor.js new file mode 100644 index 0000000000..5f7bc6cbd1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.strike does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.strike), + false, + 'isConstructor(String.prototype.strike) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.strike(); +}, '`new String.prototype.strike()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/strike/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/prop-desc.js new file mode 100644 index 0000000000..61061060d1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.strike +es6id: B.2.3.12 +description: Property descriptor for String.prototype.strike +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "strike", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/strike/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/strike/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/this-val-tostring-err.js new file mode 100644 index 0000000000..77cd44264e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/strike/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.strike +es6id: B.2.3.12 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.strike.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sub/B.2.3.13.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/B.2.3.13.js new file mode 100644 index 0000000000..53f0bcda58 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/B.2.3.13.js @@ -0,0 +1,25 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.sub returns a string of HTML describing a single HTML + subscript element. The element's content is the `this` value of the + function invocation, coerced to a string. + es6id: B.2.3.13 +---*/ + +assert.sameValue('_'.sub(), '_'); +assert.sameValue('<'.sub(), '<'); +assert.sameValue(String.prototype.sub.call(0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.sub.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.sub.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sub/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sub/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/length.js new file mode 100644 index 0000000000..974cc7036a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.13 +description: > + String.prototype.sub.length is 0. +info: | + String.prototype.sub ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.sub, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 0 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sub/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/name.js new file mode 100644 index 0000000000..4b2ed6a5d4 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.13 +description: > + String.prototype.sub.name is "sub". +info: | + String.prototype.sub ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.sub, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "sub" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sub/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/not-a-constructor.js new file mode 100644 index 0000000000..3c8b054e9a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/not-a-constructor.js @@ -0,0 +1,30 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.sub does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(String.prototype.sub), false, 'isConstructor(String.prototype.sub) must return false'); + +assert.throws(TypeError, () => { + new String.prototype.sub(); +}, '`new String.prototype.sub()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sub/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/prop-desc.js new file mode 100644 index 0000000000..775210ff41 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.sub +es6id: B.2.3.13 +description: Property descriptor for String.prototype.sub +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "sub", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sub/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sub/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/this-val-tostring-err.js new file mode 100644 index 0000000000..1b91b44e57 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sub/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.sub +es6id: B.2.3.13 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.sub.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/B.2.3.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/B.2.3.js new file mode 100644 index 0000000000..fb9eb065b8 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/B.2.3.js @@ -0,0 +1,18 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: B.2.3 +description: > + Object.getOwnPropertyDescriptor returns data desc for functions on + built-ins (String.prototype.substr) +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "substr", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-falsey.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-falsey.js new file mode 100644 index 0000000000..3de74fd5cf --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-falsey.js @@ -0,0 +1,39 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.substr +es6id: B.2.3.1 +description: > + Behavior when "length" is a false-converting value other than `undefined` +info: | + [...] + 4. If length is undefined, let end be +∞; otherwise let end be ? + ToInteger(length). + [...] + 7. Let resultLength be min(max(end, 0), size - intStart). + 8. If resultLength ≤ 0, return the empty String "". + 9. Return a String containing resultLength consecutive code units from S + beginning with the code unit at index intStart. +---*/ + +assert.sameValue('abc'.substr(0, false), '', 'start: 0, length: false'); +assert.sameValue('abc'.substr(1, false), '', 'start: 1, length: false'); +assert.sameValue('abc'.substr(2, false), '', 'start: 2, length: false'); +assert.sameValue('abc'.substr(3, false), '', 'start: 3, length: false'); + +assert.sameValue('abc'.substr(0, NaN), '', 'start: 0, length: NaN'); +assert.sameValue('abc'.substr(1, NaN), '', 'start: 1, length: NaN'); +assert.sameValue('abc'.substr(2, NaN), '', 'start: 2, length: NaN'); +assert.sameValue('abc'.substr(3, NaN), '', 'start: 3, length: NaN'); + +assert.sameValue('abc'.substr(0, ''), '', 'start: 0, length: ""'); +assert.sameValue('abc'.substr(1, ''), '', 'start: 1, length: ""'); +assert.sameValue('abc'.substr(2, ''), '', 'start: 2, length: ""'); +assert.sameValue('abc'.substr(3, ''), '', 'start: 3, length: ""'); + +assert.sameValue('abc'.substr(0, null), '', 'start: 0, length: null'); +assert.sameValue('abc'.substr(1, null), '', 'start: 1, length: null'); +assert.sameValue('abc'.substr(2, null), '', 'start: 2, length: null'); +assert.sameValue('abc'.substr(3, null), '', 'start: 3, length: null'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-negative.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-negative.js new file mode 100644 index 0000000000..48e90b1aac --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-negative.js @@ -0,0 +1,33 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.substr +es6id: B.2.3.1 +description: Behavior when "length" is a negative number +info: | + [...] + 7. Let resultLength be min(max(end, 0), size - intStart). + 8. If resultLength ≤ 0, return the empty String "". +---*/ + +assert.sameValue('abc'.substr(0, -1), '', '0, -1'); +assert.sameValue('abc'.substr(0, -2), '', '0, -2'); +assert.sameValue('abc'.substr(0, -3), '', '0, -3'); +assert.sameValue('abc'.substr(0, -4), '', '0, -4'); + +assert.sameValue('abc'.substr(1, -1), '', '1, -1'); +assert.sameValue('abc'.substr(1, -2), '', '1, -2'); +assert.sameValue('abc'.substr(1, -3), '', '1, -3'); +assert.sameValue('abc'.substr(1, -4), '', '1, -4'); + +assert.sameValue('abc'.substr(2, -1), '', '2, -1'); +assert.sameValue('abc'.substr(2, -2), '', '2, -2'); +assert.sameValue('abc'.substr(2, -3), '', '2, -3'); +assert.sameValue('abc'.substr(2, -4), '', '2, -4'); + +assert.sameValue('abc'.substr(3, -1), '', '3, -1'); +assert.sameValue('abc'.substr(3, -2), '', '3, -2'); +assert.sameValue('abc'.substr(3, -3), '', '3, -3'); +assert.sameValue('abc'.substr(3, -4), '', '3, -4'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-positive.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-positive.js new file mode 100644 index 0000000000..e95b688bd7 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-positive.js @@ -0,0 +1,38 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.substr +es6id: B.2.3.1 +description: Behavior when "length" is a positive number +info: | + [...] + 4. If length is undefined, let end be +∞; otherwise let end be ? + ToInteger(length). + [...] + 7. Let resultLength be min(max(end, 0), size - intStart). + 8. If resultLength ≤ 0, return the empty String "". + 9. Return a String containing resultLength consecutive code units from S + beginning with the code unit at index intStart. +---*/ + +assert.sameValue('abc'.substr(0, 1), 'a', '0, 1'); +assert.sameValue('abc'.substr(0, 2), 'ab', '0, 1'); +assert.sameValue('abc'.substr(0, 3), 'abc', '0, 1'); +assert.sameValue('abc'.substr(0, 4), 'abc', '0, 1'); + +assert.sameValue('abc'.substr(1, 1), 'b', '1, 1'); +assert.sameValue('abc'.substr(1, 2), 'bc', '1, 1'); +assert.sameValue('abc'.substr(1, 3), 'bc', '1, 1'); +assert.sameValue('abc'.substr(1, 4), 'bc', '1, 1'); + +assert.sameValue('abc'.substr(2, 1), 'c', '2, 1'); +assert.sameValue('abc'.substr(2, 2), 'c', '2, 1'); +assert.sameValue('abc'.substr(2, 3), 'c', '2, 1'); +assert.sameValue('abc'.substr(2, 4), 'c', '2, 1'); + +assert.sameValue('abc'.substr(3, 1), '', '3, 1'); +assert.sameValue('abc'.substr(3, 2), '', '3, 1'); +assert.sameValue('abc'.substr(3, 3), '', '3, 1'); +assert.sameValue('abc'.substr(3, 4), '', '3, 1'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-to-int-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-to-int-err.js new file mode 100644 index 0000000000..fe367827b0 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-to-int-err.js @@ -0,0 +1,29 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.substr +es6id: B.2.3.1 +description: > + Behavior when "length" integer conversion triggers an abrupt completion +info: | + [...] + 3. Let intStart be ? ToInteger(start). +features: [Symbol] +---*/ + +var symbol = Symbol(''); +var len = { + valueOf: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + ''.substr(0, len); +}); + +assert.throws(TypeError, function() { + ''.substr(0, symbol); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-undef.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-undef.js new file mode 100644 index 0000000000..abaee99f0e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length-undef.js @@ -0,0 +1,36 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.substr +es6id: B.2.3.1 +description: Behavior when "length" is not defined +info: | + [...] + 4. If length is undefined, let end be +∞; otherwise let end be ? + ToInteger(length). + [...] + 7. Let resultLength be min(max(end, 0), size - intStart). + 8. If resultLength ≤ 0, return the empty String "". + 9. Return a String containing resultLength consecutive code units from S + beginning with the code unit at index intStart. +---*/ + +assert.sameValue('abc'.substr(0), 'abc', 'start: 0, length: unspecified'); +assert.sameValue('abc'.substr(1), 'bc', 'start: 1, length: unspecified'); +assert.sameValue('abc'.substr(2), 'c', 'start: 2, length: unspecified'); +assert.sameValue('abc'.substr(3), '', 'start: 3, length: unspecified'); + +assert.sameValue( + 'abc'.substr(0, undefined), 'abc', 'start: 0, length: undefined' +); +assert.sameValue( + 'abc'.substr(1, undefined), 'bc', 'start: 1, length: undefined' +); +assert.sameValue( + 'abc'.substr(2, undefined), 'c', 'start: 2, length: undefined' +); +assert.sameValue( + 'abc'.substr(3, undefined), '', 'start: 3, length: undefined' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length.js new file mode 100644 index 0000000000..93654798c4 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.1 +description: > + String.prototype.substr.length is 2. +info: | + String.prototype.substr (start, length) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.substr, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 2 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/name.js new file mode 100644 index 0000000000..d9b3306250 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.1 +description: > + String.prototype.substr.name is "substr". +info: | + String.prototype.substr (start, length) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.substr, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "substr" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/not-a-constructor.js new file mode 100644 index 0000000000..821d6473a4 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/not-a-constructor.js @@ -0,0 +1,34 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.substr does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue( + isConstructor(String.prototype.substr), + false, + 'isConstructor(String.prototype.substr) must return false' +); + +assert.throws(TypeError, () => { + new String.prototype.substr(); +}, '`new String.prototype.substr()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-and-length-as-numbers.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-and-length-as-numbers.js new file mode 100644 index 0000000000..0b0df5427a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-and-length-as-numbers.js @@ -0,0 +1,94 @@ +// Copyright (C) 2022 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.substr +description: > + Test String.prototype.substr with number inputs for start and length. +---*/ + +function ToIntegerOrInfinity(arg) { + assert.sameValue(typeof arg, "number"); + + return Number.isNaN(arg) ? 0 : Math.trunc(arg); +} + +// Basic reference implementation. Expects all inputs have the correct type. +function StringSubstr(string, start, length) { + // Steps 1-2. + assert.sameValue(typeof string, "string"); + + // Step 3. + let size = string.length; + + // Step 4. + let intStart = ToIntegerOrInfinity(start); + + // Steps 5-7. + if (intStart === -Infinity) { + intStart = 0; + } else if (intStart < 0) { + intStart = Math.max(size + intStart, 0); + } else { + intStart = Math.min(intStart, size) + } + + // |0 <= intStart <= size| now holds. + assert(0 <= intStart && intStart <= size); + + // Step 8. + let intLength = length === undefined ? size : ToIntegerOrInfinity(length); + + // Step 9. + intLength = Math.min(Math.max(intLength, 0), size); + + // |0 <= intLength <= size| now holds. + assert(0 <= intLength && intLength <= size); + + // Step 10. + let intEnd = Math.min(intStart + intLength, size); + + // |intStart <= intEnd <= size| now holds. + assert(intStart <= intEnd && intEnd <= size); + + // Step 11. + // + // Call `substring` and check the result is correct. + let result = string.substring(intStart, intEnd); + + assert.sameValue(result.length, intEnd - intStart); + + for (let i = 0; i < result.length; ++i) { + assert.sameValue(result[i], string[intStart + i]); + } + + return result; +} + +const positiveIntegers = [ + 0, 1, 2, 3, 4, 5, 10, 100, +]; + +const integers = [ + ...positiveIntegers, + ...positiveIntegers.map(v => -v), +]; + +const numbers = [ + ...integers, + ...integers.map(v => v + 0.5), + -Infinity, Infinity, NaN, +]; + +for (let string of ["", "a", "ab", "abc"]) { + for (let start of numbers) { + for (let length of [...numbers, undefined]) { + let actual = string.substr(start, length); + let expected = StringSubstr(string, start, length); + + assert.sameValue(actual, expected, `"${string}".substr(${start}, ${length})`); + } + } +} + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-negative.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-negative.js new file mode 100644 index 0000000000..de56b29e68 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-negative.js @@ -0,0 +1,19 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.substr +es6id: B.2.3.1 +description: Behavior when "start" is a negative number +info: | + [...] + 6. If intStart < 0, let intStart be max(size + intStart, 0). +---*/ + +assert.sameValue('abc'.substr(-1), 'c'); +assert.sameValue('abc'.substr(-2), 'bc'); +assert.sameValue('abc'.substr(-3), 'abc'); +assert.sameValue('abc'.substr(-4), 'abc', 'size + intStart < 0'); + +assert.sameValue('abc'.substr(-1.1), 'c', 'floating point rounding semantics'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-to-int-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-to-int-err.js new file mode 100644 index 0000000000..4511de91ba --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/start-to-int-err.js @@ -0,0 +1,37 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.substr +es6id: B.2.3.1 +description: > + Behavior when "start" integer conversion triggers an abrupt completion +info: | + [...] + 3. Let intStart be ? ToInteger(start). +features: [Symbol] +---*/ + +var lengthCallCount = 0; +var symbol = Symbol(''); +var start = { + valueOf: function() { + throw new Test262Error(); + } +}; +var len = { + valueOf: function() { + lengthCallCount += 1; + } +}; + +assert.throws(Test262Error, function() { + ''.substr(start, len); +}); + +assert.throws(TypeError, function() { + ''.substr(symbol, len); +}); + +assert.sameValue(lengthCallCount, 0); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/surrogate-pairs.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/surrogate-pairs.js new file mode 100644 index 0000000000..605596d335 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/surrogate-pairs.js @@ -0,0 +1,26 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.substr +es6id: B.2.3.1 +description: > + Behavior when input string contains a surrogate pair +info: | + [...] + 4. If length is undefined, let end be +∞; otherwise let end be ? + ToInteger(length). + [...] + 7. Let resultLength be min(max(end, 0), size - intStart). + 8. If resultLength ≤ 0, return the empty String "". + 9. Return a String containing resultLength consecutive code units from S + beginning with the code unit at index intStart. +---*/ + +assert.sameValue('\ud834\udf06'.substr(0), '\ud834\udf06', 'start: 0'); +assert.sameValue('\ud834\udf06'.substr(1), '\udf06', 'start: 1'); +assert.sameValue('\ud834\udf06'.substr(2), '', 'start: 2'); +assert.sameValue('\ud834\udf06'.substr(0, 0), '', 'end: 0'); +assert.sameValue('\ud834\udf06'.substr(0, 1), '\ud834', 'end: 1'); +assert.sameValue('\ud834\udf06'.substr(0, 2), '\ud834\udf06', 'end: 2'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/this-non-obj-coerce.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/this-non-obj-coerce.js new file mode 100644 index 0000000000..7036c9e250 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/this-non-obj-coerce.js @@ -0,0 +1,23 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.substr +es6id: B.2.3.1 +description: Behavior when "this" value is not Object-coercible +info: | + 1. Let O be ? RequireObjectCoercible(this value). +---*/ + +var substr = String.prototype.substr; + +assert.sameValue(typeof substr, 'function'); + +assert.throws(TypeError, function() { + substr.call(undefined); +}, 'undefined'); + +assert.throws(TypeError, function() { + substr.call(null); +}, 'null'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/substr/this-to-str-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/this-to-str-err.js new file mode 100644 index 0000000000..669f572a04 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/substr/this-to-str-err.js @@ -0,0 +1,23 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.substr +es6id: B.2.3.1 +description: Behavior when string conversion triggers an abrupt completion +info: | + 1. Let O be ? RequireObjectCoercible(this value). + 2. Let S be ? ToString(O). +---*/ + +var substr = String.prototype.substr; +var thisValue = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + substr.call(thisValue); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sup/B.2.3.14.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/B.2.3.14.js new file mode 100644 index 0000000000..a54131b658 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/B.2.3.14.js @@ -0,0 +1,25 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Tests taken from: +// http://mathias.html5.org/tests/javascript/string/ + +/*--- + description: > + String.prototype.sup returns a string of HTML describing a single HTML + superscript element. The element's content is the `this` value of the + function invocation, coerced to a string. + es6id: B.2.3.14 +---*/ + +assert.sameValue('_'.sup(), '_'); +assert.sameValue('<'.sup(), '<'); +assert.sameValue(String.prototype.sup.call(0x2A), '42'); +assert.throws(TypeError, function() { + String.prototype.sup.call(undefined); +}); +assert.throws(TypeError, function() { + String.prototype.sup.call(null); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sup/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sup/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/length.js new file mode 100644 index 0000000000..d05dc61b42 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.14 +description: > + String.prototype.sup.length is 0. +info: | + String.prototype.sup ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.sup, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 0 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sup/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/name.js new file mode 100644 index 0000000000..054d5484ef --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.3.14 +description: > + String.prototype.sup.name is "sup". +info: | + String.prototype.sup ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype.sup, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "sup" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sup/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/not-a-constructor.js new file mode 100644 index 0000000000..461a34d60e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/not-a-constructor.js @@ -0,0 +1,30 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + String.prototype.sup does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(String.prototype.sup), false, 'isConstructor(String.prototype.sup) must return false'); + +assert.throws(TypeError, () => { + new String.prototype.sup(); +}, '`new String.prototype.sup()` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sup/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/prop-desc.js new file mode 100644 index 0000000000..c22448d3fb --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/prop-desc.js @@ -0,0 +1,20 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.sup +es6id: B.2.3.14 +description: Property descriptor for String.prototype.sup +info: | + Every other data property described in clauses 18 through 26 and in Annex + B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +---*/ + +verifyProperty(String.prototype, "sup", { + enumerable: false, + writable: true, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sup/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/sup/this-val-tostring-err.js b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/this-val-tostring-err.js new file mode 100644 index 0000000000..ef2669921f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/sup/this-val-tostring-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-string.prototype.sup +es6id: B.2.3.14 +description: Abrupt completion when coercing "this" value to string +info: | + B.2.3.2.1 Runtime Semantics: CreateHTML + + 1. Let str be ? RequireObjectCoercible(string). + 2. Let S be ? ToString(str). +---*/ + +var thisVal = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + String.prototype.sup.call(thisVal); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/length.js new file mode 100644 index 0000000000..76d4b87fc5 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/length.js @@ -0,0 +1,33 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.trimLeft +description: > + String.prototype.trimLeft.length is 0. +info: > + String.prototype.trimLeft ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +features: [string-trimming] +---*/ + +verifyProperty(String.prototype.trimLeft, "length", { + value: 0, + enumerable: false, + writable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/name.js new file mode 100644 index 0000000000..277da5d95f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/name.js @@ -0,0 +1,24 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.trimLeft +description: > + String.prototype.trimLeft.name is "trimStart". +info: > + String.prototype.trimLeft ( ) + + The function object that is the initial value of String.prototype.trimLeft is the same function object that is the initial value of String.prototype.trimStart. + +includes: [propertyHelper.js] +features: [string-trimming, String.prototype.trimStart] +---*/ + +verifyProperty(String.prototype.trimLeft, "name", { + value: "trimStart", + enumerable: false, + writable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/prop-desc.js new file mode 100644 index 0000000000..f1589dbacc --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/prop-desc.js @@ -0,0 +1,24 @@ +// Copyright (C) 2017 The Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.trimLeft +description: > + "trimLeft" property of String.prototype +info: > + 17 ECMAScript Standard Built-in Objects: + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +features: [string-trimming] +---*/ + +verifyProperty(String.prototype, "trimLeft", { + enumerable: false, + writable: true, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/reference-trimStart.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/reference-trimStart.js new file mode 100644 index 0000000000..d9c709aff1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/reference-trimStart.js @@ -0,0 +1,19 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.trimLeft +description: > + String.prototype.trimLeft is a reference to String.prototype.trimStart. +info: > + String.prototype.trimLeft ( ) + + The function object that is the initial value of String.prototype.trimLeft + is the same function object that is the initial value of + String.prototype.trimStart. +features: [string-trimming] +---*/ + +assert.sameValue(String.prototype.trimLeft, String.prototype.trimStart); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimLeft/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/browser.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/length.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/length.js new file mode 100644 index 0000000000..53ece40072 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/length.js @@ -0,0 +1,33 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.trimRight +description: > + String.prototype.trimRight.length is 0. +info: > + String.prototype.trimRight ( ) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +features: [string-trimming] +---*/ + +verifyProperty(String.prototype.trimRight, "length", { + value: 0, + enumerable: false, + writable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/name.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/name.js new file mode 100644 index 0000000000..43f7b94849 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/name.js @@ -0,0 +1,23 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.trimRight +description: > + String.prototype.trimRight.name is "trimEnd". +info: > + String.prototype.trimRight ( )# + + The function object that is the initial value of String.prototype.trimRight is the same function object that is the initial value of String.prototype.trimEnd. +includes: [propertyHelper.js] +features: [string-trimming, String.prototype.trimEnd] +---*/ + +verifyProperty(String.prototype.trimRight, "name", { + value: "trimEnd", + enumerable: false, + writable: false, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/prop-desc.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/prop-desc.js new file mode 100644 index 0000000000..a2b1e52c90 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/prop-desc.js @@ -0,0 +1,24 @@ +// Copyright (C) 2017 The Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.trimRight +description: > + "trimRight" property of String.prototype +info: > + 17 ECMAScript Standard Built-in Objects: + + Every other data property described in clauses 18 through 26 and in Annex B.2 + has the attributes { [[Writable]]: true, [[Enumerable]]: false, + [[Configurable]]: true } unless otherwise specified. +includes: [propertyHelper.js] +features: [string-trimming] +---*/ + +verifyProperty(String.prototype, "trimRight", { + enumerable: false, + writable: true, + configurable: true, +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/reference-trimEnd.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/reference-trimEnd.js new file mode 100644 index 0000000000..23a375af15 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/reference-trimEnd.js @@ -0,0 +1,19 @@ +// Copyright (C) 2017 Valerie Young. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-string.prototype.trimRight +description: > + String.prototype.trimRight is a reference to String.prototype.trimEnd. +info: > + String.prototype.trimRight ( ) + + The function object that is the initial value of String.prototype.trimRight + is the same function object that is the initial value of + String.prototype.trimEnd. +features: [string-trimming] +---*/ + +assert.sameValue(String.prototype.trimRight, String.prototype.trimEnd); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/shell.js b/js/src/tests/test262/annexB/built-ins/String/prototype/trimRight/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/String/shell.js b/js/src/tests/test262/annexB/built-ins/String/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/browser.js b/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/browser.js b/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/iterator-method-emulates-undefined.js b/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/iterator-method-emulates-undefined.js new file mode 100644 index 0000000000..5e41a374eb --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/iterator-method-emulates-undefined.js @@ -0,0 +1,37 @@ +// Copyright (C) 2020 Alexey Shvayka. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-%typedarray%.from +description: > + [[IsHTMLDDA]] object as @@iterator method gets called. +info: | + %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) + + [...] + 5. Let usingIterator be ? GetMethod(items, @@iterator). + 6. If usingIterator is not undefined, then + a. Let values be ? IterableToList(source, usingIterator). + + IterableToList ( items, method ) + + 1. Let iteratorRecord be ? GetIterator(items, sync, method). + + GetIterator ( obj [ , hint [ , method ] ] ) + + [...] + 4. Let iterator be ? Call(method, obj). + 5. If Type(iterator) is not Object, throw a TypeError exception. +includes: [testTypedArray.js] +features: [Symbol.iterator, TypedArray, IsHTMLDDA] +---*/ + +var items = {}; +items[Symbol.iterator] = $262.IsHTMLDDA; + +testWithTypedArrayConstructors(function(TypedArray) { + assert.throws(TypeError, function() { + TypedArray.from(items); + }); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/shell.js b/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/shell.js new file mode 100644 index 0000000000..05fecd6ef1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/from/shell.js @@ -0,0 +1,161 @@ +// GENERATED, DO NOT EDIT +// file: testTypedArray.js +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +description: | + Collection of functions used to assert the correctness of TypedArray objects. +defines: + - floatArrayConstructors + - nonClampedIntArrayConstructors + - intArrayConstructors + - typedArrayConstructors + - TypedArray + - testWithTypedArrayConstructors + - nonAtomicsFriendlyTypedArrayConstructors + - testWithAtomicsFriendlyTypedArrayConstructors + - testWithNonAtomicsFriendlyTypedArrayConstructors + - testTypedArrayConversions +---*/ + +var floatArrayConstructors = [ + Float64Array, + Float32Array +]; + +var nonClampedIntArrayConstructors = [ + Int32Array, + Int16Array, + Int8Array, + Uint32Array, + Uint16Array, + Uint8Array +]; + +var intArrayConstructors = nonClampedIntArrayConstructors.concat([Uint8ClampedArray]); + +// Float16Array is a newer feature +// adding it to this list unconditionally would cause implementations lacking it to fail every test which uses it +if (typeof Float16Array !== 'undefined') { + floatArrayConstructors.push(Float16Array); +} + +/** + * Array containing every non-bigint typed array constructor. + */ + +var typedArrayConstructors = floatArrayConstructors.concat(intArrayConstructors); + +/** + * The %TypedArray% intrinsic constructor function. + */ +var TypedArray = Object.getPrototypeOf(Int8Array); + +/** + * Callback for testing a typed array constructor. + * + * @callback typedArrayConstructorCallback + * @param {Function} Constructor the constructor object to test with. + */ + +/** + * Calls the provided function for every typed array constructor. + * + * @param {typedArrayConstructorCallback} f - the function to call for each typed array constructor. + * @param {Array} selected - An optional Array with filtered typed arrays + */ +function testWithTypedArrayConstructors(f, selected) { + var constructors = selected || typedArrayConstructors; + for (var i = 0; i < constructors.length; ++i) { + var constructor = constructors[i]; + try { + f(constructor); + } catch (e) { + e.message += " (Testing with " + constructor.name + ".)"; + throw e; + } + } +} + +var nonAtomicsFriendlyTypedArrayConstructors = floatArrayConstructors.concat([Uint8ClampedArray]); +/** + * Calls the provided function for every non-"Atomics Friendly" typed array constructor. + * + * @param {typedArrayConstructorCallback} f - the function to call for each typed array constructor. + * @param {Array} selected - An optional Array with filtered typed arrays + */ +function testWithNonAtomicsFriendlyTypedArrayConstructors(f) { + testWithTypedArrayConstructors(f, nonAtomicsFriendlyTypedArrayConstructors); +} + +/** + * Calls the provided function for every "Atomics Friendly" typed array constructor. + * + * @param {typedArrayConstructorCallback} f - the function to call for each typed array constructor. + * @param {Array} selected - An optional Array with filtered typed arrays + */ +function testWithAtomicsFriendlyTypedArrayConstructors(f) { + testWithTypedArrayConstructors(f, [ + Int32Array, + Int16Array, + Int8Array, + Uint32Array, + Uint16Array, + Uint8Array, + ]); +} + +/** + * Helper for conversion operations on TypedArrays, the expected values + * properties are indexed in order to match the respective value for each + * TypedArray constructor + * @param {Function} fn - the function to call for each constructor and value. + * will be called with the constructor, value, expected + * value, and a initial value that can be used to avoid + * a false positive with an equivalent expected value. + */ +function testTypedArrayConversions(byteConversionValues, fn) { + var values = byteConversionValues.values; + var expected = byteConversionValues.expected; + + testWithTypedArrayConstructors(function(TA) { + var name = TA.name.slice(0, -5); + + return values.forEach(function(value, index) { + var exp = expected[name][index]; + var initial = 0; + if (exp === 0) { + initial = 1; + } + fn(TA, value, exp, initial); + }); + }); +} + +/** + * Checks if the given argument is one of the float-based TypedArray constructors. + * + * @param {constructor} ctor - the value to check + * @returns {boolean} + */ +function isFloatTypedArrayConstructor(arg) { + return floatArrayConstructors.indexOf(arg) !== -1; +} + +/** + * Determines the precision of the given float-based TypedArray constructor. + * + * @param {constructor} ctor - the value to check + * @returns {string} "half", "single", or "double" for Float16Array, Float32Array, and Float64Array respectively. + */ +function floatTypedArrayConstructorPrecision(FA) { + if (typeof Float16Array !== "undefined" && FA === Float16Array) { + return "half"; + } else if (FA === Float32Array) { + return "single"; + } else if (FA === Float64Array) { + return "double"; + } else { + throw new Error("Malformed test - floatTypedArrayConstructorPrecision called with non-float TypedArray"); + } +} diff --git a/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/shell.js b/js/src/tests/test262/annexB/built-ins/TypedArrayConstructors/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/browser.js b/js/src/tests/test262/annexB/built-ins/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/escape/argument_bigint.js b/js/src/tests/test262/annexB/built-ins/escape/argument_bigint.js new file mode 100644 index 0000000000..20a0340cce --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/argument_bigint.js @@ -0,0 +1,18 @@ +// Copyright (C) 2020 Qu Xing. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +description: Input is a BigInt +info: | + B.2.1.1 escape ( string ) + + 1. Let string be ? ToString(string). + ... +features: [BigInt] +---*/ + +assert.sameValue(escape(1n), '1'); + +assert.sameValue(escape(-1n), '-1'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/argument_types.js b/js/src/tests/test262/annexB/built-ins/escape/argument_types.js new file mode 100644 index 0000000000..cb04677445 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/argument_types.js @@ -0,0 +1,35 @@ +// Copyright (C) 2020 Qu Xing. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +description: Input is a null, undefined, boolean or Number +info: | + B.2.1.1 escape ( string ) + + 1. Let string be ? ToString(string). + ... +---*/ + +assert.sameValue(escape(null), 'null'); + +assert.sameValue(escape(undefined), 'undefined'); + +assert.sameValue(escape(), 'undefined'); + +assert.sameValue(escape(true), 'true'); + +assert.sameValue(escape(false), 'false'); + +assert.sameValue(escape(-0), '0'); + +assert.sameValue(escape(0), '0'); + +assert.sameValue(escape(1), '1'); + +assert.sameValue(escape(NaN), 'NaN'); + +assert.sameValue(escape(Number.POSITIVE_INFINITY), 'Infinity'); + +assert.sameValue(escape(Number.NEGATIVE_INFINITY), '-Infinity'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/browser.js b/js/src/tests/test262/annexB/built-ins/escape/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/escape/empty-string.js b/js/src/tests/test262/annexB/built-ins/escape/empty-string.js new file mode 100644 index 0000000000..65143c90d1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/empty-string.js @@ -0,0 +1,19 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +es6id: B.2.1.1 +description: Input is the empty string +info: | + 1. Let string be ? ToString(string). + 2. Let length be the number of code units in string. + 3. Let R be the empty string. + 4. Let k be 0. + 5. Repeat, while k < length, + [...] + 6. Return R. +---*/ + +assert.sameValue(escape(''), ''); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/escape-above-astral.js b/js/src/tests/test262/annexB/built-ins/escape/escape-above-astral.js new file mode 100644 index 0000000000..7ab8e7ed0d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/escape-above-astral.js @@ -0,0 +1,24 @@ +// Copyright (C) 2017 Microsoft Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +es6id: B.2.1.1 +description: Escaping of code units above 255 from string with extended Unicode escape sequence +info: | + [...] + 5. Repeat, while k < length, + a. Let char be the code unit (represented as a 16-bit unsigned integer) + at index k within string. + [...] + c. Else if char ≥ 256, then + i. Let S be a String containing six code units "%uwxyz" where wxyz + are the code units of the four uppercase hexadecimal digits + encoding the value of char. + [...] +---*/ + +assert.sameValue( + escape('\u{10401}'), '%uD801%uDC01', '\\u{10401} => \\uD801\\uDC01 (surrogate pairs encoded in string)' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/escape-above.js b/js/src/tests/test262/annexB/built-ins/escape/escape-above.js new file mode 100644 index 0000000000..347530476e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/escape-above.js @@ -0,0 +1,32 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +es6id: B.2.1.1 +description: Escaping of code units above 255 +info: | + [...] + 5. Repeat, while k < length, + a. Let char be the code unit (represented as a 16-bit unsigned integer) + at index k within string. + [...] + c. Else if char ≥ 256, then + i. Let S be a String containing six code units "%uwxyz" where wxyz + are the code units of the four uppercase hexadecimal digits + encoding the value of char. + [...] +---*/ + +assert.sameValue( + escape('\u0100\u0101\u0102'), '%u0100%u0101%u0102', '\\u0100\\u0101\\u0102' +); + +assert.sameValue( + escape('\ufffd\ufffe\uffff'), '%uFFFD%uFFFE%uFFFF', '\\ufffd\\ufffd\\ufffd' +); + +assert.sameValue( + escape('\ud834\udf06'), '%uD834%uDF06', '\\ud834\\udf06 (surrogate pairs)' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/escape-below.js b/js/src/tests/test262/annexB/built-ins/escape/escape-below.js new file mode 100644 index 0000000000..197fcf70e8 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/escape-below.js @@ -0,0 +1,56 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +es6id: B.2.1.1 +description: Escaping of code units below 255 +info: | + [...] + 5. Repeat, while k < length, + a. Let char be the code unit (represented as a 16-bit unsigned integer) + at index k within string. + [...] + d. Else char < 256, + i. Let S be a String containing three code units "%xy" where xy are + the code units of two uppercase hexadecimal digits encoding the + value of char. + [...] +---*/ + +assert.sameValue( + escape('\x00\x01\x02\x03'), + '%00%01%02%03', + 'characters: \\x00\\x01\\x02\\x03' +); + +assert.sameValue( + escape('!"#$%&\'()'), + '%21%22%23%24%25%26%27%28%29', + 'characters preceding "*": !"#$%&\'()' +); + +assert.sameValue(escape(','), '%2C', 'character between "+" and "-": ,'); + +assert.sameValue( + escape(':;<=>?'), + '%3A%3B%3C%3D%3E%3F', + 'characters between "9" and "@": :;<=>?' +); + +assert.sameValue( + escape('[\\]^'), '%5B%5C%5D%5E', 'characters between "Z" and "_": [\\]^' +); + +assert.sameValue(escape('`'), '%60', 'character between "_" and "a": `'); + +assert.sameValue( + escape('{|}~\x7f\x80'), + '%7B%7C%7D%7E%7F%80', + 'characters following "z": {|}~\\x7f\\x80' +); + +assert.sameValue( + escape('\xfd\xfe\xff'), '%FD%FE%FF', '\\xfd\\xfe\\xff' +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/length.js b/js/src/tests/test262/annexB/built-ins/escape/length.js new file mode 100644 index 0000000000..6d8c672f6e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.1.1 +description: > + escape.length is 1. +info: | + escape (string) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(escape, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 1 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/name.js b/js/src/tests/test262/annexB/built-ins/escape/name.js new file mode 100644 index 0000000000..6a3cf986a1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.1.1 +description: > + escape.name is "escape". +info: | + escape (string) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(escape, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "escape" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/escape/not-a-constructor.js new file mode 100644 index 0000000000..9fd1e0deb7 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/not-a-constructor.js @@ -0,0 +1,30 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + escape does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(escape), false, 'isConstructor(escape) must return false'); + +assert.throws(TypeError, () => { + new escape(''); +}, '`new escape(\'\')` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/prop-desc.js b/js/src/tests/test262/annexB/built-ins/escape/prop-desc.js new file mode 100644 index 0000000000..6669166aae --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: B.2.1 +description: > + Object.getOwnPropertyDescriptor returns data desc for functions on + built-ins (Global.escape) +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof this.escape, "function"); +assert.sameValue(typeof this["escape"], "function"); + +verifyProperty(this, "escape", { + writable: true, + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/shell.js b/js/src/tests/test262/annexB/built-ins/escape/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/escape/to-primitive-err.js b/js/src/tests/test262/annexB/built-ins/escape/to-primitive-err.js new file mode 100644 index 0000000000..b172fe2b28 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/to-primitive-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2020 Qu Xing. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +description: If [Symbol.toPrimitive] method returned an object, it should throw a TypeError +info: | + B.2.1.1 escape ( string ) + + 1. Let string be ? ToString(string). + ... +features: [Symbol.toPrimitive] +---*/ + +var obj = { + toString() { throw new Test262Error('this should be unreachable'); }, + valueOf() { throw new Test262Error('this should be unreachable'); }, + [Symbol.toPrimitive]() { return function(){}; } +}; + +assert.throws(TypeError, function() { + escape(obj); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/to-primitive-observe.js b/js/src/tests/test262/annexB/built-ins/escape/to-primitive-observe.js new file mode 100644 index 0000000000..4b0cc7935c --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/to-primitive-observe.js @@ -0,0 +1,22 @@ +// Copyright (C) 2020 Qu Xing. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +description: Observable operations from string coercion +info: | + B.2.1.1 escape ( string ) + + 1. Let string be ? ToString(string). + ... +features: [Symbol.toPrimitive] +---*/ + +var obj = { + toString() { throw new Test262Error('this should be unreachable'); }, + valueOf() { throw new Test262Error('this should be unreachable'); }, + [Symbol.toPrimitive]() { return 'success'; } +}; + +assert.sameValue(escape(obj), 'success'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/to-string-err-symbol.js b/js/src/tests/test262/annexB/built-ins/escape/to-string-err-symbol.js new file mode 100644 index 0000000000..6cd2663e3f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/to-string-err-symbol.js @@ -0,0 +1,18 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +es6id: B.2.1.1 +description: Abrupt completion from `ToString` operation (Symbol value) +info: | + 1. Let string be ? ToString(string). +features: [Symbol] +---*/ + +var s = Symbol(''); + +assert.throws(TypeError, function() { + escape(s); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/to-string-err.js b/js/src/tests/test262/annexB/built-ins/escape/to-string-err.js new file mode 100644 index 0000000000..5d5aaa8b2f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/to-string-err.js @@ -0,0 +1,21 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +es6id: B.2.1.1 +description: Abrupt completion from `ToString` operation +info: | + 1. Let string be ? ToString(string). +---*/ + +var obj = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + escape(obj); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/to-string-observe.js b/js/src/tests/test262/annexB/built-ins/escape/to-string-observe.js new file mode 100644 index 0000000000..c9dcd49f99 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/to-string-observe.js @@ -0,0 +1,54 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +es6id: B.2.1.1 +description: Observable operations from string coercion +info: | + 1. Let string be ? ToString(string). +---*/ + +var log, obj; + +log = ''; +obj = { + toString: function() { + log += 'toString'; + }, + valueOf: function() { + log += 'valueOf'; + } +}; + +escape(obj); + +assert.sameValue(log, 'toString'); + +log = ''; +obj = { + toString: null, + valueOf: function() { + log += 'valueOf'; + } +}; + +escape(obj); + +assert.sameValue(log, 'valueOf'); + +log = ''; +obj = { + toString: function() { + log += 'toString'; + return {}; + }, + valueOf: function() { + log += 'valueOf'; + } +}; + +escape(obj); + +assert.sameValue(log, 'toStringvalueOf'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/escape/unmodified.js b/js/src/tests/test262/annexB/built-ins/escape/unmodified.js new file mode 100644 index 0000000000..0f8e82c4ae --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/escape/unmodified.js @@ -0,0 +1,23 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-escape-string +es6id: B.2.1.1 +description: Do not escape a specific set of characters +info: | + [...] + 5. Repeat, while k < length, + a. Let char be the code unit (represented as a 16-bit unsigned integer) + at index k within string. + b. If char is one of the code units in + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@*_+-./", + then + i. Let S be a String containing the single code unit char. + [...] +---*/ + +var passthrough = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@*_+-./'; + +assert.sameValue(escape(passthrough), passthrough); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/shell.js b/js/src/tests/test262/annexB/built-ins/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/unescape/argument_bigint.js b/js/src/tests/test262/annexB/built-ins/unescape/argument_bigint.js new file mode 100644 index 0000000000..00f17cb5e7 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/argument_bigint.js @@ -0,0 +1,18 @@ +// Copyright (C) 2020 Qu Xing. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +description: Input is a BigInt +info: | + B.2.1.2 unescape ( string ) + + 1. Set string to ? ToString(string). + .... +features: [BigInt] +---*/ + +assert.sameValue(unescape(1n), '1'); + +assert.sameValue(unescape(-1n), '-1'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/argument_types.js b/js/src/tests/test262/annexB/built-ins/unescape/argument_types.js new file mode 100644 index 0000000000..008e1a1bdb --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/argument_types.js @@ -0,0 +1,35 @@ +// Copyright (C) 2020 Qu Xing. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +description: Input is a null, undefined, boolean or Number +info: | + B.2.1.2 unescape ( string ) + + 1. Set string to ? ToString(string). + ... +---*/ + +assert.sameValue(unescape(null), 'null'); + +assert.sameValue(unescape(undefined), 'undefined'); + +assert.sameValue(unescape(), 'undefined'); + +assert.sameValue(unescape(true), 'true'); + +assert.sameValue(unescape(false), 'false'); + +assert.sameValue(unescape(-0), '0'); + +assert.sameValue(unescape(0), '0'); + +assert.sameValue(unescape(1), '1'); + +assert.sameValue(unescape(NaN), 'NaN'); + +assert.sameValue(unescape(Number.POSITIVE_INFINITY), 'Infinity'); + +assert.sameValue(unescape(Number.NEGATIVE_INFINITY), '-Infinity'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/browser.js b/js/src/tests/test262/annexB/built-ins/unescape/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/built-ins/unescape/empty-string.js b/js/src/tests/test262/annexB/built-ins/unescape/empty-string.js new file mode 100644 index 0000000000..41c491239e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/empty-string.js @@ -0,0 +1,19 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: Input is the empty string +info: | + 1. Let string be ? ToString(string). + 2. Let length be the number of code units in string. + 3. Let R be the empty string. + 4. Let k be 0. + 5. Repeat, while k ≠ length, + [...] + 6. Return R. +---*/ + +assert.sameValue(unescape(''), ''); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/four-ignore-bad-u.js b/js/src/tests/test262/annexB/built-ins/unescape/four-ignore-bad-u.js new file mode 100644 index 0000000000..09b9fd30f3 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/four-ignore-bad-u.js @@ -0,0 +1,30 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: > + Does not transform four-character patterns that are not prefixed with the + character "u" +info: | + [...] + 5. Repeat, while k ≠ length, + [...] + a. Let c be the code unit at index k within string. + b. If c is %, then + i. If k ≤ length-6 and the code unit at index k+1 within string is u + and the four code units at indices k+2, k+3, k+4, and k+5 within + string are all hexadecimal digits, then + 1. Let c be the code unit whose value is the integer represented + by the four hexadecimal digits at indices k+2, k+3, k+4, and + k+5 within string. + 2. Increase k by 5. + [...] +---*/ + +assert.sameValue(unescape('%U0000'), '%U0000'); +assert.sameValue(unescape('%t0000'), '%t0000'); +assert.sameValue(unescape('%v0000'), '%v0000'); +assert.sameValue(unescape('%%0000'), '%\x0000'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/four-ignore-end-str.js b/js/src/tests/test262/annexB/built-ins/unescape/four-ignore-end-str.js new file mode 100644 index 0000000000..da1a016bc4 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/four-ignore-end-str.js @@ -0,0 +1,96 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: > + Does not transform four-character patterns that are interrupted by the end + of the string +info: | + [...] + 5. Repeat, while k ≠ length, + [...] + a. Let c be the code unit at index k within string. + b. If c is %, then + i. If k ≤ length-6 and the code unit at index k+1 within string is u + and the four code units at indices k+2, k+3, k+4, and k+5 within + string are all hexadecimal digits, then + 1. Let c be the code unit whose value is the integer represented + by the four hexadecimal digits at indices k+2, k+3, k+4, and + k+5 within string. + 2. Increase k by 5. + [...] +---*/ + +assert.sameValue(unescape('%u'), '%u'); + +assert.sameValue(unescape('%u0'), '%u0'); +assert.sameValue(unescape('%u1'), '%u1'); +assert.sameValue(unescape('%u2'), '%u2'); +assert.sameValue(unescape('%u3'), '%u3'); +assert.sameValue(unescape('%u4'), '%u4'); +assert.sameValue(unescape('%u5'), '%u5'); +assert.sameValue(unescape('%u6'), '%u6'); +assert.sameValue(unescape('%u7'), '%u7'); +assert.sameValue(unescape('%u8'), '%u8'); +assert.sameValue(unescape('%u9'), '%u9'); +assert.sameValue(unescape('%ua'), '%ua'); +assert.sameValue(unescape('%uA'), '%uA'); +assert.sameValue(unescape('%ub'), '%ub'); +assert.sameValue(unescape('%uB'), '%uB'); +assert.sameValue(unescape('%uc'), '%uc'); +assert.sameValue(unescape('%uC'), '%uC'); +assert.sameValue(unescape('%ud'), '%ud'); +assert.sameValue(unescape('%uD'), '%uD'); +assert.sameValue(unescape('%ue'), '%ue'); +assert.sameValue(unescape('%uE'), '%uE'); +assert.sameValue(unescape('%uf'), '%uf'); +assert.sameValue(unescape('%uF'), '%uF'); + +assert.sameValue(unescape('%u00'), '%u00'); +assert.sameValue(unescape('%u01'), '%u01'); +assert.sameValue(unescape('%u02'), '%u02'); +assert.sameValue(unescape('%u03'), '%u03'); +assert.sameValue(unescape('%u04'), '%u04'); +assert.sameValue(unescape('%u05'), '%u05'); +assert.sameValue(unescape('%u06'), '%u06'); +assert.sameValue(unescape('%u07'), '%u07'); +assert.sameValue(unescape('%u08'), '%u08'); +assert.sameValue(unescape('%u09'), '%u09'); +assert.sameValue(unescape('%u0a'), '%u0a'); +assert.sameValue(unescape('%u0A'), '%u0A'); +assert.sameValue(unescape('%u0b'), '%u0b'); +assert.sameValue(unescape('%u0B'), '%u0B'); +assert.sameValue(unescape('%u0c'), '%u0c'); +assert.sameValue(unescape('%u0C'), '%u0C'); +assert.sameValue(unescape('%u0d'), '%u0d'); +assert.sameValue(unescape('%u0D'), '%u0D'); +assert.sameValue(unescape('%u0e'), '%u0e'); +assert.sameValue(unescape('%u0E'), '%u0E'); +assert.sameValue(unescape('%u0f'), '%u0f'); +assert.sameValue(unescape('%u0F'), '%u0F'); + +assert.sameValue(unescape('%u000'), '%u000'); +assert.sameValue(unescape('%u001'), '%u001'); +assert.sameValue(unescape('%u002'), '%u002'); +assert.sameValue(unescape('%u003'), '%u003'); +assert.sameValue(unescape('%u004'), '%u004'); +assert.sameValue(unescape('%u005'), '%u005'); +assert.sameValue(unescape('%u006'), '%u006'); +assert.sameValue(unescape('%u007'), '%u007'); +assert.sameValue(unescape('%u008'), '%u008'); +assert.sameValue(unescape('%u009'), '%u009'); +assert.sameValue(unescape('%u00a'), '%u00a'); +assert.sameValue(unescape('%u00A'), '%u00A'); +assert.sameValue(unescape('%u00b'), '%u00b'); +assert.sameValue(unescape('%u00B'), '%u00B'); +assert.sameValue(unescape('%u00c'), '%u00c'); +assert.sameValue(unescape('%u00C'), '%u00C'); +assert.sameValue(unescape('%u00d'), '%u00d'); +assert.sameValue(unescape('%u00D'), '%u00D'); +assert.sameValue(unescape('%u00e'), '%u00e'); +assert.sameValue(unescape('%u00E'), '%u00E'); +assert.sameValue(unescape('%u00f'), '%u00f'); +assert.sameValue(unescape('%u00F'), '%u00F'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/four-ignore-non-hex.js b/js/src/tests/test262/annexB/built-ins/unescape/four-ignore-non-hex.js new file mode 100644 index 0000000000..411a62c551 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/four-ignore-non-hex.js @@ -0,0 +1,45 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: > + Does not transform four-character patterns that contain non-hexadecimal + digits +info: | + [...] + 5. Repeat, while k ≠ length, + [...] + a. Let c be the code unit at index k within string. + b. If c is %, then + i. If k ≤ length-6 and the code unit at index k+1 within string is u + and the four code units at indices k+2, k+3, k+4, and k+5 within + string are all hexadecimal digits, then + 1. Let c be the code unit whose value is the integer represented + by the four hexadecimal digits at indices k+2, k+3, k+4, and + k+5 within string. + 2. Increase k by 5. + [...] +---*/ + +assert.sameValue(unescape('%u000%0'), '%u000%0'); + +assert.sameValue(unescape('%u000g0'), '%u000g0'); +assert.sameValue(unescape('%u000G0'), '%u000G0'); +assert.sameValue(unescape('%u00g00'), '%u00g00'); +assert.sameValue(unescape('%u00G00'), '%u00G00'); +assert.sameValue(unescape('%u0g000'), '%u0g000'); +assert.sameValue(unescape('%u0G000'), '%u0G000'); +assert.sameValue(unescape('%ug0000'), '%ug0000'); +assert.sameValue(unescape('%uG0000'), '%uG0000'); + +assert.sameValue(unescape('%u000u0'), '%u000u0'); +assert.sameValue(unescape('%u000U0'), '%u000U0'); +assert.sameValue(unescape('%u00u00'), '%u00u00'); +assert.sameValue(unescape('%u00U00'), '%u00U00'); +assert.sameValue(unescape('%u0u000'), '%u0u000'); +assert.sameValue(unescape('%u0U000'), '%u0U000'); +assert.sameValue(unescape('%uu0000'), '%uu0000'); +assert.sameValue(unescape('%uU0000'), '%uU0000'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/four.js b/js/src/tests/test262/annexB/built-ins/unescape/four.js new file mode 100644 index 0000000000..35aeb4f74e --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/four.js @@ -0,0 +1,75 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: Translation of patterns with four digits +info: | + [...] + 5. Repeat, while k ≠ length, + [...] + a. Let c be the code unit at index k within string. + b. If c is %, then + i. If k ≤ length-6 and the code unit at index k+1 within string is u + and the four code units at indices k+2, k+3, k+4, and k+5 within + string are all hexadecimal digits, then + 1. Let c be the code unit whose value is the integer represented + by the four hexadecimal digits at indices k+2, k+3, k+4, and + k+5 within string. + 2. Increase k by 5. + [...] +---*/ + +assert.sameValue(unescape('%0%u00000'), '%0\x000', '%u0000'); +assert.sameValue(unescape('%0%u00010'), '%0\x010', '%u0001'); + +assert.sameValue(unescape('%0%u00290'), '%0)0', '%002900'); +assert.sameValue(unescape('%0%u002a0'), '%0*0', '%002a00'); +assert.sameValue(unescape('%0%u002A0'), '%0*0', '%002A00'); +assert.sameValue(unescape('%0%u002b0'), '%0+0', '%002b00'); +assert.sameValue(unescape('%0%u002B0'), '%0+0', '%002B00'); +assert.sameValue(unescape('%0%u002c0'), '%0,0', '%002c00'); +assert.sameValue(unescape('%0%u002C0'), '%0,0', '%002C00'); +assert.sameValue(unescape('%0%u002d0'), '%0-0', '%002d00'); +assert.sameValue(unescape('%0%u002D0'), '%0-0', '%002D00'); + +assert.sameValue(unescape('%0%u00390'), '%090', '%003900'); +assert.sameValue(unescape('%0%u003a0'), '%0:0', '%003A00'); +assert.sameValue(unescape('%0%u003A0'), '%0:0', '%003A00'); + +assert.sameValue(unescape('%0%u003f0'), '%0?0', '%003f00'); +assert.sameValue(unescape('%0%u003F0'), '%0?0', '%003F00'); +assert.sameValue(unescape('%0%u00400'), '%0@0', '%004000'); + +assert.sameValue(unescape('%0%u005a0'), '%0Z0', '%005a00'); +assert.sameValue(unescape('%0%u005A0'), '%0Z0', '%005A00'); +assert.sameValue(unescape('%0%u005b0'), '%0[0', '%005b00'); +assert.sameValue(unescape('%0%u005B0'), '%0[0', '%005B00'); + +assert.sameValue(unescape('%0%u005e0'), '%0^0', '%005e00'); +assert.sameValue(unescape('%0%u005E0'), '%0^0', '%005E00'); +assert.sameValue(unescape('%0%u005f0'), '%0_0', '%005f00'); +assert.sameValue(unescape('%0%u005F0'), '%0_0', '%005F00'); +assert.sameValue(unescape('%0%u00600'), '%0`0', '%006000'); +assert.sameValue(unescape('%0%u00610'), '%0a0', '%006100'); + +assert.sameValue(unescape('%0%u007a0'), '%0z0', '%007a00'); +assert.sameValue(unescape('%0%u007A0'), '%0z0', '%007A00'); +assert.sameValue(unescape('%0%u007b0'), '%0{0', '%007b00'); +assert.sameValue(unescape('%0%u007B0'), '%0{0', '%007B00'); + +assert.sameValue(unescape('%0%ufffe0'), '%0\ufffe0', '%ufffe'); +assert.sameValue(unescape('%0%uFffe0'), '%0\ufffe0', '%uFffe'); +assert.sameValue(unescape('%0%ufFfe0'), '%0\ufffe0', '%ufFfe'); +assert.sameValue(unescape('%0%uffFe0'), '%0\ufffe0', '%uffFe'); +assert.sameValue(unescape('%0%ufffE0'), '%0\ufffe0', '%ufffE'); +assert.sameValue(unescape('%0%uFFFE0'), '%0\ufffe0', '%uFFFE'); + +assert.sameValue(unescape('%0%uffff0'), '%0\uffff0', '%uffff'); +assert.sameValue(unescape('%0%uFfff0'), '%0\uffff0', '%uFfff'); +assert.sameValue(unescape('%0%ufFff0'), '%0\uffff0', '%ufFff'); +assert.sameValue(unescape('%0%uffFf0'), '%0\uffff0', '%uffFf'); +assert.sameValue(unescape('%0%ufffF0'), '%0\uffff0', '%ufffF'); +assert.sameValue(unescape('%0%uFFFF0'), '%0\uffff0', '%uFFFF'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/length.js b/js/src/tests/test262/annexB/built-ins/unescape/length.js new file mode 100644 index 0000000000..2bd578f6ec --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/length.js @@ -0,0 +1,32 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.1.2 +description: > + unescape.length is 1. +info: | + unescape (string) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, has a length + property whose value is an integer. Unless otherwise specified, this + value is equal to the largest number of named arguments shown in the + subclause headings for the function description, including optional + parameters. However, rest parameters shown using the form “...name” + are not included in the default argument count. + + Unless otherwise specified, the length property of a built-in Function + object has the attributes { [[Writable]]: false, [[Enumerable]]: false, + [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(unescape, "length", { + enumerable: false, + writable: false, + configurable: true, + value: 1 +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/name.js b/js/src/tests/test262/annexB/built-ins/unescape/name.js new file mode 100644 index 0000000000..e356381754 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/name.js @@ -0,0 +1,29 @@ +// Copyright (C) 2015 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es6id: B.2.1.2 +description: > + unescape.name is "unescape". +info: | + unescape (string) + + 17 ECMAScript Standard Built-in Objects: + Every built-in Function object, including constructors, that is not + identified as an anonymous function has a name property whose value + is a String. + + Unless otherwise specified, the name property of a built-in Function + object, if it exists, has the attributes { [[Writable]]: false, + [[Enumerable]]: false, [[Configurable]]: true }. +includes: [propertyHelper.js] +---*/ + +verifyProperty(unescape, "name", { + enumerable: false, + writable: false, + configurable: true, + value: "unescape" +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/not-a-constructor.js b/js/src/tests/test262/annexB/built-ins/unescape/not-a-constructor.js new file mode 100644 index 0000000000..71c32f22c2 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/not-a-constructor.js @@ -0,0 +1,30 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-ecmascript-standard-built-in-objects +description: > + unescape does not implement [[Construct]], is not new-able +info: | + ECMAScript Function Objects + + Built-in function objects that are not identified as constructors do not + implement the [[Construct]] internal method unless otherwise specified in + the description of a particular function. + + sec-evaluatenew + ... + 7. If IsConstructor(constructor) is false, throw a TypeError exception. + ... +includes: [isConstructor.js] +features: [Reflect.construct, arrow-function] +---*/ + +assert.sameValue(isConstructor(unescape), false, 'isConstructor(unescape) must return false'); + +assert.throws(TypeError, () => { + new unescape(''); +}, '`new unescape(\'\')` throws TypeError'); + + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/prop-desc.js b/js/src/tests/test262/annexB/built-ins/unescape/prop-desc.js new file mode 100644 index 0000000000..67a88bc87a --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/prop-desc.js @@ -0,0 +1,21 @@ +// Copyright (c) 2012 Ecma International. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +es5id: B.2.2 +description: > + Object.getOwnPropertyDescriptor returns data desc for functions on + built-ins (Global.unescape) +includes: [propertyHelper.js] +---*/ + +assert.sameValue(typeof this.unescape, "function"); +assert.sameValue(typeof this["unescape"], "function"); + +verifyProperty(this, "unescape", { + writable: true, + enumerable: false, + configurable: true +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/shell.js b/js/src/tests/test262/annexB/built-ins/unescape/shell.js new file mode 100644 index 0000000000..eda1477282 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/shell.js @@ -0,0 +1,24 @@ +// GENERATED, DO NOT EDIT +// file: isConstructor.js +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + Test if a given function is a constructor function. +defines: [isConstructor] +features: [Reflect.construct] +---*/ + +function isConstructor(f) { + if (typeof f !== "function") { + throw new Test262Error("isConstructor invoked with a non-function value"); + } + + try { + Reflect.construct(function(){}, [], f); + } catch (e) { + return false; + } + return true; +} diff --git a/js/src/tests/test262/annexB/built-ins/unescape/to-primitive-err.js b/js/src/tests/test262/annexB/built-ins/unescape/to-primitive-err.js new file mode 100644 index 0000000000..57b1f1d621 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/to-primitive-err.js @@ -0,0 +1,24 @@ +// Copyright (C) 2020 Qu Xing. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +description: If [Symbol.toPrimitive] method returned an object, it should throw a TypeError +info: | + B.2.1.2 unescape ( string ) + + 1. Set string to ? ToString(string). + .... +features: [Symbol.toPrimitive] +---*/ + +var obj = { + toString() { throw new Test262Error('this should be unreachable'); }, + valueOf() { throw new Test262Error('this should be unreachable'); }, + [Symbol.toPrimitive]() { return function(){}; } +}; + +assert.throws(TypeError, function() { + unescape(obj); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/to-primitive-observe.js b/js/src/tests/test262/annexB/built-ins/unescape/to-primitive-observe.js new file mode 100644 index 0000000000..3c6c2068e1 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/to-primitive-observe.js @@ -0,0 +1,22 @@ +// Copyright (C) 2020 Qu Xing. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +description: Observable operations from string coercion +info: | + B.2.1.2 unescape ( string ) + + 1. Set string to ? ToString(string). + .... +features: [Symbol.toPrimitive] +---*/ + +var obj = { + toString() { throw new Test262Error('this should be unreachable'); }, + valueOf() { throw new Test262Error('this should be unreachable'); }, + [Symbol.toPrimitive]() { return 'success'; } +}; + +assert.sameValue(unescape(obj), 'success'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/to-string-err-symbol.js b/js/src/tests/test262/annexB/built-ins/unescape/to-string-err-symbol.js new file mode 100644 index 0000000000..b09654e049 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/to-string-err-symbol.js @@ -0,0 +1,18 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: Abrupt completion from `ToString` operation (Symbol value) +info: | + 1. Let string be ? ToString(string). +features: [Symbol] +---*/ + +var s = Symbol(''); + +assert.throws(TypeError, function() { + unescape(s); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/to-string-err.js b/js/src/tests/test262/annexB/built-ins/unescape/to-string-err.js new file mode 100644 index 0000000000..6bb51700c9 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/to-string-err.js @@ -0,0 +1,21 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: Abrupt completion from `ToString` operation +info: | + 1. Let string be ? ToString(string). +---*/ + +var obj = { + toString: function() { + throw new Test262Error(); + } +}; + +assert.throws(Test262Error, function() { + unescape(obj); +}); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/to-string-observe.js b/js/src/tests/test262/annexB/built-ins/unescape/to-string-observe.js new file mode 100644 index 0000000000..bfba45da2d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/to-string-observe.js @@ -0,0 +1,54 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: Observable operations from string coercion +info: | + 1. Let string be ? ToString(string). +---*/ + +var log, obj; + +log = ''; +obj = { + toString: function() { + log += 'toString'; + }, + valueOf: function() { + log += 'valueOf'; + } +}; + +unescape(obj); + +assert.sameValue(log, 'toString'); + +log = ''; +obj = { + toString: null, + valueOf: function() { + log += 'valueOf'; + } +}; + +unescape(obj); + +assert.sameValue(log, 'valueOf'); + +log = ''; +obj = { + toString: function() { + log += 'toString'; + return {}; + }, + valueOf: function() { + log += 'valueOf'; + } +}; + +unescape(obj); + +assert.sameValue(log, 'toStringvalueOf'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/two-ignore-end-str.js b/js/src/tests/test262/annexB/built-ins/unescape/two-ignore-end-str.js new file mode 100644 index 0000000000..faabd5a50d --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/two-ignore-end-str.js @@ -0,0 +1,49 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: > + Does not transform two-character patterns that are interrupted by the end + of the string +info: | + [...] + 5. Repeat, while k ≠ length, + [...] + a. Let c be the code unit at index k within string. + b. If c is %, then + [...] + ii. Else if k ≤ length-3 and the two code units at indices k+1 and + k+2 within string are both hexadecimal digits, then + 1. Let c be the code unit whose value is the integer represented + by two zeroes plus the two hexadecimal digits at indices k+1 + and k+2 within string. + 2. Increase k by 2. + [...] +---*/ + +assert.sameValue(unescape('%'), '%'); +assert.sameValue(unescape('%0'), '%0'); +assert.sameValue(unescape('%1'), '%1'); +assert.sameValue(unescape('%2'), '%2'); +assert.sameValue(unescape('%3'), '%3'); +assert.sameValue(unescape('%4'), '%4'); +assert.sameValue(unescape('%5'), '%5'); +assert.sameValue(unescape('%6'), '%6'); +assert.sameValue(unescape('%7'), '%7'); +assert.sameValue(unescape('%8'), '%8'); +assert.sameValue(unescape('%9'), '%9'); +assert.sameValue(unescape('%a'), '%a'); +assert.sameValue(unescape('%A'), '%A'); +assert.sameValue(unescape('%b'), '%b'); +assert.sameValue(unescape('%B'), '%B'); +assert.sameValue(unescape('%c'), '%c'); +assert.sameValue(unescape('%C'), '%C'); +assert.sameValue(unescape('%d'), '%d'); +assert.sameValue(unescape('%D'), '%D'); +assert.sameValue(unescape('%e'), '%e'); +assert.sameValue(unescape('%E'), '%E'); +assert.sameValue(unescape('%f'), '%f'); +assert.sameValue(unescape('%F'), '%F'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/two-ignore-non-hex.js b/js/src/tests/test262/annexB/built-ins/unescape/two-ignore-non-hex.js new file mode 100644 index 0000000000..04d8948211 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/two-ignore-non-hex.js @@ -0,0 +1,37 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: > + Does not transform two-character patterns that contain non-hexadecimal + digits +info: | + [...] + 5. Repeat, while k ≠ length, + [...] + a. Let c be the code unit at index k within string. + b. If c is %, then + [...] + ii. Else if k ≤ length-3 and the two code units at indices k+1 and + k+2 within string are both hexadecimal digits, then + 1. Let c be the code unit whose value is the integer represented + by two zeroes plus the two hexadecimal digits at indices k+1 + and k+2 within string. + 2. Increase k by 2. + [...] +---*/ + +assert.sameValue(unescape('%0%0'), '%0%0'); + +assert.sameValue(unescape('%0g0'), '%0g0'); +assert.sameValue(unescape('%0G0'), '%0G0'); +assert.sameValue(unescape('%g00'), '%g00'); +assert.sameValue(unescape('%G00'), '%G00'); + +assert.sameValue(unescape('%0u0'), '%0u0'); +assert.sameValue(unescape('%0U0'), '%0U0'); +assert.sameValue(unescape('%u00'), '%u00'); +assert.sameValue(unescape('%U00'), '%U00'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/built-ins/unescape/two.js b/js/src/tests/test262/annexB/built-ins/unescape/two.js new file mode 100644 index 0000000000..5f28cdd0c9 --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/unescape/two.js @@ -0,0 +1,71 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-unescape-string +es6id: B.2.1.2 +description: Translation of patterns with two digits +info: | + [...] + 5. Repeat, while k ≠ length, + [...] + a. Let c be the code unit at index k within string. + b. If c is %, then + [...] + ii. Else if k ≤ length-3 and the two code units at indices k+1 and + k+2 within string are both hexadecimal digits, then + 1. Let c be the code unit whose value is the integer represented + by two zeroes plus the two hexadecimal digits at indices k+1 + and k+2 within string. + 2. Increase k by 2. + [...] +---*/ + +assert.sameValue(unescape('%0%0000'), '%0\x0000', '%00'); +assert.sameValue(unescape('%0%0100'), '%0\x0100', '%01'); + +assert.sameValue(unescape('%0%2900'), '%0)00', '%29'); +assert.sameValue(unescape('%0%2a00'), '%0*00', '%2a'); +assert.sameValue(unescape('%0%2A00'), '%0*00', '%2A'); +assert.sameValue(unescape('%0%2b00'), '%0+00', '%2b'); +assert.sameValue(unescape('%0%2B00'), '%0+00', '%2B'); +assert.sameValue(unescape('%0%2c00'), '%0,00', '%2c'); +assert.sameValue(unescape('%0%2C00'), '%0,00', '%2C'); +assert.sameValue(unescape('%0%2d00'), '%0-00', '%2d'); +assert.sameValue(unescape('%0%2D00'), '%0-00', '%2D'); + +assert.sameValue(unescape('%0%3900'), '%0900', '%39'); +assert.sameValue(unescape('%0%3a00'), '%0:00', '%3A'); +assert.sameValue(unescape('%0%3A00'), '%0:00', '%3A'); + +assert.sameValue(unescape('%0%3f00'), '%0?00', '%3f'); +assert.sameValue(unescape('%0%3F00'), '%0?00', '%3F'); +assert.sameValue(unescape('%0%4000'), '%0@00', '%40'); + +assert.sameValue(unescape('%0%5a00'), '%0Z00', '%5a'); +assert.sameValue(unescape('%0%5A00'), '%0Z00', '%5A'); +assert.sameValue(unescape('%0%5b00'), '%0[00', '%5b'); +assert.sameValue(unescape('%0%5B00'), '%0[00', '%5B'); + +assert.sameValue(unescape('%0%5e00'), '%0^00', '%5e'); +assert.sameValue(unescape('%0%5E00'), '%0^00', '%5E'); +assert.sameValue(unescape('%0%5f00'), '%0_00', '%5f'); +assert.sameValue(unescape('%0%5F00'), '%0_00', '%5F'); +assert.sameValue(unescape('%0%6000'), '%0`00', '%60'); +assert.sameValue(unescape('%0%6100'), '%0a00', '%61'); + +assert.sameValue(unescape('%0%7a00'), '%0z00', '%7a'); +assert.sameValue(unescape('%0%7A00'), '%0z00', '%7A'); +assert.sameValue(unescape('%0%7b00'), '%0{00', '%7b'); +assert.sameValue(unescape('%0%7B00'), '%0{00', '%7B'); + +assert.sameValue(unescape('%0%fe00'), '%0\xfe00', '%fe'); +assert.sameValue(unescape('%0%Fe00'), '%0\xfe00', '%Fe'); +assert.sameValue(unescape('%0%fE00'), '%0\xfe00', '%fE'); +assert.sameValue(unescape('%0%FE00'), '%0\xfe00', '%FE'); + +assert.sameValue(unescape('%0%ff00'), '%0\xff00', '%ff'); +assert.sameValue(unescape('%0%Ff00'), '%0\xff00', '%Ff'); +assert.sameValue(unescape('%0%fF00'), '%0\xff00', '%fF'); +assert.sameValue(unescape('%0%FF00'), '%0\xff00', '%FF'); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/annexB/language/browser.js b/js/src/tests/test262/annexB/language/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/language/comments/browser.js b/js/src/tests/test262/annexB/language/comments/browser.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/language/comments/multi-line-html-close.js b/js/src/tests/test262/annexB/language/comments/multi-line-html-close.js new file mode 100644 index 0000000000..5f5046bfe7 --- /dev/null +++ b/js/src/tests/test262/annexB/language/comments/multi-line-html-close.js @@ -0,0 +1,90 @@ +// |reftest| error:Test262Error +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-html-like-comments +description: Optional HTMLCloseComment following MultiLineComment +info: | + Comment :: + MultiLineComment + SingleLineComment + SingleLineHTMLOpenComment + SingleLineHTMLCloseComment + SingleLineDelimitedComment + + MultiLineComment :: + /* FirstCommentLine[opt] LineTerminator MultiLineCommentChars[opt] * / HTMLCloseComment[opt] + + HTMLCloseComment :: + WhiteSpaceSequence[opt] SingleLineDelimitedCommentSequence[opt] --> SingleLineCommentChars[opt] +negative: + phase: runtime + type: Test262Error +---*/ + +var counter = 0; +/* +*/--> +counter += 1; + +/* +*/-->the comment extends to these characters +counter += 1; + +/* optional FirstCommentLine +*/-->the comment extends to these characters +counter += 1; + +/* +optional +MultiLineCommentChars */-->the comment extends to these characters +counter += 1; + +/* +*/ /* optional SingleLineDelimitedCommentSequence */-->the comment extends to these characters +counter += 1; + +/* +*/ /**/ /* second optional SingleLineDelimitedCommentSequence */-->the comment extends to these characters +counter += 1; + +// The V8 engine exhibited a bug where HTMLCloseComment was not recognized +// within MultiLineComment in cases where MultiLineComment was not the first +// token on the line of source text. The following tests demonstrate the same +// productions listed above with the addition of such a leading token. + +0/* +*/--> +counter += 1; + +0/* +*/-->the comment extends to these characters +counter += 1; + +0/* optional FirstCommentLine +*/-->the comment extends to these characters +counter += 1; + +0/* +optional +MultiLineCommentChars */-->the comment extends to these characters +counter += 1; + +0/* +*/ /* optional SingleLineDelimitedCommentSequence */-->the comment extends to these characters +counter += 1; + +0/* +*/ /**/ /* second optional SingleLineDelimitedCommentSequence */-->the comment extends to these characters +counter += 1; + +// Because this test concerns the interpretation of non-executable character +// sequences within ECMAScript source code, special care must be taken to +// ensure that executable code is evaluated as expected. +// +// Express the intended behavior by intentionally throwing an error; this +// guarantees that test runners will only consider the test "passing" if +// executable sequences are correctly interpreted as such. +if (counter === 12) { + throw new Test262Error(); +} diff --git a/js/src/tests/test262/annexB/language/comments/shell.js b/js/src/tests/test262/annexB/language/comments/shell.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/js/src/tests/test262/annexB/language/comments/single-line-html-close-asi.js b/js/src/tests/test262/annexB/language/comments/single-line-html-close-asi.js new file mode 100644 index 0000000000..843527d464 --- /dev/null +++ b/js/src/tests/test262/annexB/language/comments/single-line-html-close-asi.js @@ -0,0 +1,39 @@ +// |reftest| error:Test262Error +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-html-like-comments +description: > + A SingleLineHTMLCloseComment is considered to be a LineTerminator for + purposes of parsing by the syntactic grammar. +info: | + Comment :: + MultiLineComment + SingleLineComment + SingleLineHTMLOpenComment + SingleLineHTMLCloseComment + SingleLineDelimitedComment + + MultiLineComment :: + /* FirstCommentLine[opt] LineTerminator MultiLineCommentChars[opt] * / HTMLCloseComment[opt] + + HTMLCloseComment :: + WhiteSpaceSequence[opt] SingleLineDelimitedCommentSequence[opt] --> SingleLineCommentChars[opt] +negative: + phase: runtime + type: Test262Error +---*/ + +var foo = [23] +-->[0]; + +// Because this test concerns the interpretation of non-executable character +// sequences within ECMAScript source code, special care must be taken to +// ensure that executable code is evaluated as expected. +// +// Express the intended behavior by intentionally throwing an error; this +// guarantees that test runners will only consider the test "passing" if +// executable sequences are correctly interpreted as such. +if (foo[0] === 23) { + throw new Test262Error(); +} diff --git a/js/src/tests/test262/annexB/language/comments/single-line-html-close-unicode-separators.js b/js/src/tests/test262/annexB/language/comments/single-line-html-close-unicode-separators.js new file mode 100644 index 0000000000..8136a5db25 --- /dev/null +++ b/js/src/tests/test262/annexB/language/comments/single-line-html-close-unicode-separators.js @@ -0,0 +1,52 @@ +// |reftest| error:Test262Error +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-html-like-comments +description: SingleLineHTMLCloseComment +info: | + Comment :: + MultiLineComment + SingleLineComment + SingleLineHTMLOpenComment + SingleLineHTMLCloseComment + SingleLineDelimitedComment + + SingleLineHTMLCloseComment :: + LineTerminatorSequenceHTMLCloseComment + + HTMLCloseComment :: + WhiteSpaceSequence[opt] SingleLineDelimitedCommentSequence[opt] --> SingleLineCommentChars[opt] +negative: + phase: runtime + type: Test262Error +---*/ + +var counter = 0; + +// DANGER WILL ROBINSON! +// +// There are UTF-8-encoded Unicode separators in the lines below. Some text +// editors (notably including, in the experience of this test's author, the +// GNOME Text Editor used to attempt to create this file) don't properly insert +// and save both these characters. (It seemed to handle copy/pasting U+2028 +// LINE SEPARATOR from GNOME Character Map just fine, but U+2029 PARAGRAPH +// SEPARATOR got mangled in the final saved file.) Be extremely careful editing +// this file to not inadvertently break this test. + +counter
-->a U+2028 LINE SEPARATOR between "counter" and "-->" means this is all a comment +counter += 1; + +counter
-->a U+2029 PARAGRAPH SEPARATOR between "counter" and "-->" means this is all a comment +counter += 1; + +// Because this test concerns the interpretation of non-executable character +// sequences within ECMAScript source code, special care must be taken to +// ensure that executable code is evaluated as expected. +// +// Express the intended behavior by intentionally throwing an error; this +// guarantees that test runners will only consider the test "passing" if +// executable sequences are correctly interpreted as such. +if (counter === 2) { + throw new Test262Error(); +} diff --git a/js/src/tests/test262/annexB/language/comments/single-line-html-close.js b/js/src/tests/test262/annexB/language/comments/single-line-html-close.js new file mode 100644 index 0000000000..f67162916a --- /dev/null +++ b/js/src/tests/test262/annexB/language/comments/single-line-html-close.js @@ -0,0 +1,50 @@ +// |reftest| error:Test262Error +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-html-like-comments +description: SingleLineHTMLCloseComment +info: | + Comment :: + MultiLineComment + SingleLineComment + SingleLineHTMLOpenComment + SingleLineHTMLCloseComment + SingleLineDelimitedComment + + SingleLineHTMLCloseComment :: + LineTerminatorSequence HTMLCloseComment + + HTMLCloseComment :: + WhiteSpaceSequence[opt] SingleLineDelimitedCommentSequence[opt] --> SingleLineCommentChars[opt] +negative: + phase: runtime + type: Test262Error +---*/ + +var counter = 0; +--> +counter += 1; + +-->the comment extends to these characters +counter += 1; + + -->the comment extends to these characters +counter += 1; + +/* optional SingleLineDelimitedCommentSequence */-->the comment extends to these characters +counter += 1; + +/**/ /* second optional SingleLineDelimitedCommentSequence */-->the comment extends to these characters +counter += 1; + +// Because this test concerns the interpretation of non-executable character +// sequences within ECMAScript source code, special care must be taken to +// ensure that executable code is evaluated as expected. +// +// Express the intended behavior by intentionally throwing an error; this +// guarantees that test runners will only consider the test "passing" if +// executable sequences are correctly interpreted as such. +if (counter === 5) { + throw new Test262Error(); +} diff --git a/js/src/tests/test262/annexB/language/comments/single-line-html-open.js b/js/src/tests/test262/annexB/language/comments/single-line-html-open.js new file mode 100644 index 0000000000..c9dd1791ad --- /dev/null +++ b/js/src/tests/test262/annexB/language/comments/single-line-html-open.js @@ -0,0 +1,44 @@ +// |reftest| error:Test262Error +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-html-like-comments +description: SingleLineHTMLOpenComment +info: | + Comment :: + MultiLineComment + SingleLineComment + SingleLineHTMLOpenComment + SingleLineHTMLCloseComment + SingleLineDelimitedComment + + SingleLineHTMLOpenComment :: +