Browse Source

Fix some unicode tests (#1033)

Sébastien Ros 3 years ago
parent
commit
9e8babdbf0

+ 3 - 11
Jint.Tests.Test262/Test262Test.cs

@@ -271,10 +271,6 @@ namespace Jint.Tests.Test262
                                 skip = true;
                                 skip = true;
                                 reason = "not in spec yet";
                                 reason = "not in spec yet";
                                 break;
                                 break;
-                            case "u180e":
-                                skip = true;
-                                reason = "unicode/regexp not implemented";
-                                break;
                             case "regexp-match-indices":
                             case "regexp-match-indices":
                                 skip = true;
                                 skip = true;
                                 reason = "regexp-match-indices not implemented";
                                 reason = "regexp-match-indices not implemented";
@@ -323,16 +319,12 @@ namespace Jint.Tests.Test262
                     reason = "Esprima problem, Unexpected token *";
                     reason = "Esprima problem, Unexpected token *";
                 }
                 }
 
 
-                if (name.StartsWith("built-ins/RegExp/property-escapes/generated/"))
-                {
-                    skip = true;
-                    reason = "Esprima problem, Invalid regular expression";
-                }
+                // Unicode regular expressions
 
 
-                if (name.StartsWith("built-ins/RegExp/unicode_"))
+                if (name.StartsWith("built-ins/RegExp/property-escapes/generated/"))
                 {
                 {
                     skip = true;
                     skip = true;
-                    reason = "Unicode support and its special cases need more work";
+                    reason = "Esprima problem";
                 }
                 }
 
 
                 // Promises
                 // Promises

+ 392 - 353
Jint.Tests.Test262/test/skipped.json

@@ -1,375 +1,414 @@
 [
 [
-  {
-    "source": "language/expressions/assignment/fn-name-lhs-cover.js",
-    "reason": "Currently quite impossible to detect if assignment target is CoverParenthesizedExpression"
-  },
-  {
-    "source": "built-ins/RegExp/character-class-escape-non-whitespace.js",
-    "reason": "Unicode support not built-in to .NET the same way, requires more work"
-  },
-  {
-    "source": "built-ins/RegExp/property-escapes/character-class.js",
-    "reason": "Unicode support not built-in to .NET the same way, requires more work"
-  },
-  {
-    "source": "built-ins/RegExp/prototype/Symbol.match/builtin-infer-unicode.js",
-    "reason": "Unicode support not built-in to .NET the same way, requires more work"
-  },
-  {
-    "source": "built-ins/RegExp/prototype/Symbol.match/builtin-success-u-return-val-groups.js",
-    "reason": "Unicode support not built-in to .NET the same way, requires more work"
-  },
-  {
-    "source": "built-ins/RegExp/prototype/Symbol.match/u-advance-after-empty.js",
-    "reason": "Unicode support not built-in to .NET the same way, requires more work"
-  },
-  {
-    "source": "built-ins/RegExp/prototype/Symbol.replace/u-advance-after-empty.js",
-    "reason": "Unicode support not built-in to .NET the same way, requires more work"
-  },
-  {
-    "source": "built-ins/RegExp/prototype/Symbol.search/u-lastindex-advance.js",
-    "reason": "Unicode support not built-in to .NET the same way, requires more work"
-  },
+    {
+        "source": "language/expressions/assignment/fn-name-lhs-cover.js",
+        "reason": "Currently quite impossible to detect if assignment target is CoverParenthesizedExpression"
+    },
+    {
+        "source": "built-ins/RegExp/character-class-escape-non-whitespace.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/property-escapes/character-class.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/prototype/Symbol.match/builtin-infer-unicode.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/prototype/Symbol.match/builtin-success-u-return-val-groups.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/prototype/Symbol.match/u-advance-after-empty.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/prototype/Symbol.replace/u-advance-after-empty.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/prototype/Symbol.search/u-lastindex-advance.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/unicode_restricted_quantifiable_assertion.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/dotall/without-dotall.js",
+        "reason": "Issue with \\r in source string"
+    },
+    {
+        "source": "built-ins/RegExp/dotall/without-dotall-unicode.js",
+        "reason": "Issue with \\r in source string"
+    },
+    {
+        "source": "built-ins/RegExp/prototype/exec/u-lastindex-value.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/unicode_restricted_character_class_escape.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/unicode_restricted_identity_escape.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/unicode_restricted_identity_escape_alpha.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/unicode_restricted_identity_escape_c.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
+    {
+        "source": "built-ins/RegExp/unicode_restricted_identity_escape_u.js",
+        "reason": "Unicode support not built-in to .NET the same way, requires more work"
+    },
 
 
+    {
+        "source": "built-ins/Function/prototype/toString/method-computed-property-name.js",
+        "reason": "requires investigation how to process complex function name evaluation for property"
+    },
 
 
-  {
-    "source": "built-ins/Function/prototype/toString/method-computed-property-name.js",
-    "reason": "requires investigation how to process complex function name evaluation for property"
-  },
 
 
+    // http://www.ecma-international.org/ecma-262/#sec-block-level-function-declarations-web-legacy-compatibility-semantics
+    {
+        "source": "language/statements/let/block-local-closure-set-before-initialization.js",
+        "reason": "not implemented (block level functions)"
+    },
+    {
+        "source": "language/block-scope/shadowing/dynamic-lookup-from-closure.js",
+        "reason": "not implemented (block level functions)"
+    },
+    {
+        "source": "language/block-scope/shadowing/lookup-from-closure.js",
+        "reason": "not implemented (block level functions)"
+    },
 
 
-  // http://www.ecma-international.org/ecma-262/#sec-block-level-function-declarations-web-legacy-compatibility-semantics
-  {
-    "source": "language/statements/let/block-local-closure-set-before-initialization.js",
-    "reason": "not implemented (block level functions)"
-  },
-  {
-    "source": "language/block-scope/shadowing/dynamic-lookup-from-closure.js",
-    "reason": "not implemented (block level functions)"
-  },
-  {
-    "source": "language/block-scope/shadowing/lookup-from-closure.js",
-    "reason": "not implemented (block level functions)"
-  },
+    {
+        "source": "language/statements/let/block-local-closure-set-before-initialization.js",
+        "reason": "http://www.ecma-international.org/ecma-262/#sec-block-level-function-declarations-web-legacy-compatibility-semantics not implemented (block level functions)"
+    },
 
 
-  {
-    "source": "language/statements/let/block-local-closure-set-before-initialization.js",
-    "reason": "http://www.ecma-international.org/ecma-262/#sec-block-level-function-declarations-web-legacy-compatibility-semantics not implemented (block level functions)"
-  },
+    {
+        "source": "built-ins/RegExp/S15.10.2.11_A1_T5.js",
+        "reason": "Logic difference in .NET RegExp / skipped in ECMA tests too"
+    },
+    {
+        "source": "built-ins/RegExp/S15.10.2.11_A1_T7.js",
+        "reason": "Logic difference in .NET RegExp / skipped in ECMA tests too"
+    },
+    {
+        "source": "built-ins/RegExp/S15.10.4.1_A8_T2.js",
+        "reason": "Logic difference in .NET RegExp / skipped in ECMA tests too"
+    },
+    {
+        "source": "built-ins/RegExp/prototype/exec/S15.10.6.2_A1_T6.js",
+        "reason": "Logic difference in .NET RegExp / skipped in ECMA tests too"
+    },
+    {
+        "source": "built-ins/RegExp/S15.10.2.5_A1_T4.js",
+        "reason": "Logic difference in .NET RegExp / skipped in ECMA tests too"
+    },
+    {
+        "source": "built-ins/RegExp/prototype/exec/u-lastindex-adv.js",
+        "reason": "Esprima strips unicode sequence and match logic does not work"
+    },
+    {
+        "source": "built-ins/String/raw/special-characters.js",
+        "reason": "Windows line ending differences"
+    },
+    {
+        "source": "language/expressions/object/method-definition/object-method-returns-promise.js",
+        "reason": "Promise not implemented"
+    },
+    {
+        "source": "language/statements/class/definition/class-method-returns-promise.js",
+        "reason": "Promise not implemented"
+    },
+    {
+        "source": "built-ins/Promise/race/resolve-element-function-name.js",
+        "reason": "there is bug in suite and bug in Jint, refer to https://github.com/sebastienros/jint/issues/888 and https://github.com/tc39/test262/issues/2985"
+    },
+    {
+        "source": "built-ins/Symbol/species/subclassing.js",
+        "reason": "subclassing not implemented"
+    },
+    {
+        "source": "built-ins/Date/subclassing.js",
+        "reason": "subclassing not implemented"
+    },
+    {
+        "source": "built-ins/Date/parse/time-value-maximum-range.js",
+        "reason": "parsing of large/small years not implemented in .NET (-271821, +271821)"
+    },
+    {
+        "source": "built-ins/Proxy/enumerate/removed-does-not-trigger.js",
+        "reason": "for-of not implemented"
+    },
+    {
+        "source": "built-ins/Map/prototype/forEach/iterates-values-deleted-then-readded.js",
+        "reason": "delete/add detection not implemented for map iterator during iteration"
+    },
+    {
+        "source": "built-ins/MapIteratorPrototype/next/iteration-mutable.js",
+        "reason": "delete/add detection not implemented for map iterator during iteration"
+    },
+    {
+        "source": "built-ins/Set/prototype/forEach/iterates-values-revisits-after-delete-re-add.js",
+        "reason": "delete/add detection not implemented for set iterator during iteration"
+    },
+    {
+        "source": "built-ins/Array/prototype/toLocaleString/primitive_this_value.js",
+        "reason": "requires toLocaleString changes"
+    },
+    {
+        "source": "built-ins/Array/prototype/toLocaleString/primitive_this_value_getter.js",
+        "reason": "requires toLocaleString changes"
+    },
+    {
+        "source": "built-ins/Object/prototype/toLocaleString/primitive_this_value_getter.js",
+        "reason": "requires toLocaleString changes"
+    },
 
 
-  {
-    "source": "built-ins/RegExp/S15.10.2.11_A1_T5.js",
-    "reason": "Logic difference in .NET RegExp / skipped in ECMA tests too"
-  },
-  {
-    "source": "built-ins/RegExp/S15.10.2.11_A1_T7.js",
-    "reason": "Logic difference in .NET RegExp / skipped in ECMA tests too"
-  },
-  {
-    "source": "built-ins/RegExp/S15.10.4.1_A8_T2.js",
-    "reason": "Logic difference in .NET RegExp / skipped in ECMA tests too"
-  },
-  {
-    "source": "built-ins/RegExp/prototype/exec/S15.10.6.2_A1_T6.js",
-    "reason": "Logic difference in .NET RegExp / skipped in ECMA tests too"
-  },
-  {
-    "source": "built-ins/RegExp/S15.10.2.5_A1_T4.js",
-    "reason": "Logic difference in .NET RegExp / skipped in ECMA tests too"
-  },
-  {
-    "source": "built-ins/RegExp/prototype/exec/u-lastindex-adv.js",
-    "reason": "Esprima strips unicode sequence and match logic does not work"
-  },
-  {
-    "source": "built-ins/String/raw/special-characters.js",
-    "reason": "Windows line ending differences"
-  },
-  {
-    "source": "language/expressions/object/method-definition/object-method-returns-promise.js",
-    "reason": "Promise not implemented"
-  },
-  {
-    "source": "language/statements/class/definition/class-method-returns-promise.js",
-    "reason": "Promise not implemented"
-  },
-  {
-    "source": "built-ins/Promise/race/resolve-element-function-name.js",
-    "reason": "there is bug in suite and bug in Jint, refer to https://github.com/sebastienros/jint/issues/888 and https://github.com/tc39/test262/issues/2985"
-  },
-  {
-    "source": "built-ins/Symbol/species/subclassing.js",
-    "reason": "subclassing not implemented"
-  },
-  {
-    "source": "built-ins/Date/subclassing.js",
-    "reason": "subclassing not implemented"
-  },
-  {
-    "source": "built-ins/Date/parse/time-value-maximum-range.js",
-    "reason": "parsing of large/small years not implemented in .NET (-271821, +271821)"
-  },
-  {
-    "source": "built-ins/Proxy/enumerate/removed-does-not-trigger.js",
-    "reason": "for-of not implemented"
-  },
-  {
-    "source": "built-ins/Map/prototype/forEach/iterates-values-deleted-then-readded.js",
-    "reason": "delete/add detection not implemented for map iterator during iteration"
-  },
-  {
-    "source": "built-ins/MapIteratorPrototype/next/iteration-mutable.js",
-    "reason": "delete/add detection not implemented for map iterator during iteration"
-  },
-  {
-    "source": "built-ins/Set/prototype/forEach/iterates-values-revisits-after-delete-re-add.js",
-    "reason": "delete/add detection not implemented for set iterator during iteration"
-  },
-  {
-    "source": "built-ins/Array/prototype/toLocaleString/primitive_this_value.js",
-    "reason": "requires toLocaleString changes"
-  },
-  {
-    "source": "built-ins/Array/prototype/toLocaleString/primitive_this_value_getter.js",
-    "reason": "requires toLocaleString changes"
-  },
-  {
-    "source": "built-ins/Object/prototype/toLocaleString/primitive_this_value_getter.js",
-    "reason": "requires toLocaleString changes"
-  },
+    {
+        "source": "built-ins/String/prototype/padEnd/observable-operations.js",
+        "reason": "observables not implemented"
+    },
+    {
+        "source": "built-ins/String/prototype/padStart/observable-operations.js",
+        "reason": "observables not implemented"
+    },
+    {
+        "source": "built-ins/StringIteratorPrototype/next/next-iteration-surrogate-pairs.js",
+        "reason": "code point iteration not implemented"
+    },
+    {
+        "source": "language/expressions/template-literal/tv-line-terminator-sequence.js",
+        "reason": "Line feed problems (git, windows, linux)"
+    },
+    {
+        "source": "built-ins/Number/prototype/toFixed/range.js",
+        "reason": "100 fraction digits is not supported due to .NET format specifier limitation"
+    },
+    {
+        "source": "language/types/number/8.5.1.js",
+        "reason": "C# can't distinguish 1.797693134862315808e+308 and 1.797693134862315708145274237317e+308"
+    },
 
 
-  {
-    "source": "built-ins/String/prototype/padEnd/observable-operations.js",
-    "reason": "observables not implemented"
-  },
-  {
-    "source": "built-ins/String/prototype/padStart/observable-operations.js",
-    "reason": "observables not implemented"
-  },
-  {
-    "source": "built-ins/StringIteratorPrototype/next/next-iteration-surrogate-pairs.js",
-    "reason": "code point iteration not implemented"
-  },
-  {
-    "source": "language/expressions/template-literal/tv-line-terminator-sequence.js",
-    "reason": "Line feed problems (git, windows, linux)"
-  },
-  {
-    "source": "built-ins/Number/prototype/toFixed/range.js",
-    "reason": "100 fraction digits is not supported due to .NET format specifier limitation"
-  },
-  {
-    "source": "language/types/number/8.5.1.js",
-    "reason": "C# can't distinguish 1.797693134862315808e+308 and 1.797693134862315708145274237317e+308"
-  },
+    // function behaviour to be implemented
+    {
+        "source": "language/expressions/function/scope-name-var-open-non-strict.js",
+        "reason": "inner binding is immutable (from parameters) Expected SameValue(«null», «function() {{ ... }}») to be true"
+    },
+    {
+        "source": "language/expressions/function/scope-name-var-open-strict.js",
+        "reason": "inner binding rejects modification (from parameters) Expected a Error to be thrown but no exception was thrown at all"
+    },
 
 
-  // function behaviour to be implemented
-  {
-    "source": "language/expressions/function/scope-name-var-open-non-strict.js",
-    "reason": "inner binding is immutable (from parameters) Expected SameValue(«null», «function() {{ ... }}») to be true"
-  },
-  {
-    "source": "language/expressions/function/scope-name-var-open-strict.js",
-    "reason": "inner binding rejects modification (from parameters) Expected a Error to be thrown but no exception was thrown at all"
-  },
+    {
+        "source": "built-ins/TypedArrayConstructors/ctors-bigint/object-arg/as-generator-iterable-returns.js",
+        "reason": "yield not implemented"
+    },
+    {
+        "source": "built-ins/TypedArrayConstructors/ctors-bigint/object-arg/iterating-throws.js",
+        "reason": "yield not implemented"
+    },
+    {
+        "source": "language/expressions/object/accessor-name-computed-yield-id.js",
+        "reason": "accessor / yield not implemented"
+    },
+    {
+        "source": "language/expressions/object/accessor-name-computed.js",
+        "reason": "yield not implemented"
+    },
+    {
+        "source": "built-ins/TypedArrayConstructors/ctors/object-arg/as-generator-iterable-returns.js",
+        "reason": "yield not implemented"
+    },
+    {
+        "source": "language/expressions/object/prop-dup-set-get-set.js",
+        "reason": "accessor not implemented"
+    },
+    {
+        "source": "language/expressions/object/accessor-name-computed-err-to-prop-key.js",
+        "reason": "accessor not implemented"
+    },
+    {
+        "source": "language/expressions/object/accessor-name-computed-err-unresolvable.js",
+        "reason": "accessor not implemented"
+    },
+    {
+        "source": "language/expressions/object/accessor-name-computed-in.js",
+        "reason": "accessor not implemented"
+    },
+    {
+        "source": "language/expressions/object/accessor-name-literal-numeric-leading-decimal.js",
+        "reason": "accessor not implemented"
+    },
+    {
+        "source": "language/expressions/object/accessor-name-literal-numeric-non-canonical.js",
+        "reason": "accessor not implemented"
+    },
+    {
+        "source": "language/expressions/object/fn-name-accessor-get.js",
+        "reason": "accessor not implemented"
+    },
+    {
+        "source": "language/expressions/object/fn-name-accessor-set.js",
+        "reason": "accessor not implemented"
+    },
+    {
+        "source": "language/expressions/object/method-definition/name-prop-name-yield-id.js",
+        "reason": "yield not implemented"
+    },
 
 
-  {
-    "source": "built-ins/TypedArrayConstructors/ctors-bigint/object-arg/as-generator-iterable-returns.js",
-    "reason": "yield not implemented"
-  },
-  {
-    "source": "built-ins/TypedArrayConstructors/ctors-bigint/object-arg/iterating-throws.js",
-    "reason": "yield not implemented"
-  },
-  {
-    "source": "language/expressions/object/accessor-name-computed-yield-id.js",
-    "reason": "accessor / yield not implemented"
-  },
-  {
-    "source": "language/expressions/object/accessor-name-computed.js",
-    "reason": "yield not implemented"
-  },
-  {
-    "source": "built-ins/TypedArrayConstructors/ctors/object-arg/as-generator-iterable-returns.js",
-    "reason": "yield not implemented"
-  },
-  {
-    "source": "language/expressions/object/prop-dup-set-get-set.js",
-    "reason": "accessor not implemented"
-  },
-  {
-    "source": "language/expressions/object/accessor-name-computed-err-to-prop-key.js",
-    "reason": "accessor not implemented"
-  },
-  {
-    "source": "language/expressions/object/accessor-name-computed-err-unresolvable.js",
-    "reason": "accessor not implemented"
-  },
-  {
-    "source": "language/expressions/object/accessor-name-computed-in.js",
-    "reason": "accessor not implemented"
-  },
-  {
-    "source": "language/expressions/object/accessor-name-literal-numeric-leading-decimal.js",
-    "reason": "accessor not implemented"
-  },
-  {
-    "source": "language/expressions/object/accessor-name-literal-numeric-non-canonical.js",
-    "reason": "accessor not implemented"
-  },
-  {
-    "source": "language/expressions/object/fn-name-accessor-get.js",
-    "reason": "accessor not implemented"
-  },
-  {
-    "source": "language/expressions/object/fn-name-accessor-set.js",
-    "reason": "accessor not implemented"
-  },
-  {
-    "source": "language/expressions/object/method-definition/name-prop-name-yield-id.js",
-    "reason": "yield not implemented"
-  },
 
 
+    {
+        "source": "language/expressions/object/method.js",
+        "reason": "super not implemented"
+    },
+    {
+        "source": "language/expressions/object/setter-super-prop.js",
+        "reason": "super not implemented"
+    },
+    {
+        "source": "language/expressions/object/getter-super-prop.js",
+        "reason": "super not implemented"
+    },
 
 
-  {
-    "source": "language/expressions/object/method.js",
-    "reason": "super not implemented"
-  },
-  {
-    "source": "language/expressions/object/setter-super-prop.js",
-    "reason": "super not implemented"
-  },
-  {
-    "source": "language/expressions/object/getter-super-prop.js",
-    "reason": "super not implemented"
-  },
 
 
+    {
+        "source": "language/expressions/arrow-function/scope-paramsbody-var-open.js",
+        "reason": "not implemented: Creation of new variable environment for the function body (as distinct from that for the function's parameters)"
+    },
+    {
+        "source": "language/expressions/function/scope-paramsbody-var-open.js",
+        "reason": "not implemented: Creation of new variable environment for the function body (as distinct from that for the function's parameters)"
+    },
+    {
+        "source": "language/expressions/object/scope-meth-paramsbody-var-open.js",
+        "reason": "not implemented: Creation of new variable environment for the function body (as distinct from that for the function's parameters)"
+    },
+    {
+        "source": "language/expressions/object/scope-setter-paramsbody-var-open.js",
+        "reason": "not implemented: Creation of new variable environment for the function body (as distinct from that for the function's parameters)"
+    },
 
 
-  {
-    "source": "language/expressions/arrow-function/scope-paramsbody-var-open.js",
-    "reason": "not implemented: Creation of new variable environment for the function body (as distinct from that for the function's parameters)"
-  },
-  {
-    "source": "language/expressions/function/scope-paramsbody-var-open.js",
-    "reason": "not implemented: Creation of new variable environment for the function body (as distinct from that for the function's parameters)"
-  },
-  {
-    "source": "language/expressions/object/scope-meth-paramsbody-var-open.js",
-    "reason": "not implemented: Creation of new variable environment for the function body (as distinct from that for the function's parameters)"
-  },
-  {
-    "source": "language/expressions/object/scope-setter-paramsbody-var-open.js",
-    "reason": "not implemented: Creation of new variable environment for the function body (as distinct from that for the function's parameters)"
-  },
+    {
+        "source": "built-ins/Object/prototype/toString/proxy-function.js",
+        "reason": "generators not implemented"
+    },
+    {
+        "source": "language/statements/class/subclass/builtin-objects/GeneratorFunction/instance-prototype.js",
+        "reason": "generators not implemented"
+    },
+    {
+        "source": "language/statements/class/subclass/builtin-objects/GeneratorFunction/regular-subclassing.js",
+        "reason": "generators not implemented"
+    },
 
 
-  {
-    "source": "built-ins/Object/prototype/toString/proxy-function.js",
-    "reason": "generators not implemented"
-  },
-  {
-    "source": "language/statements/class/subclass/builtin-objects/GeneratorFunction/instance-prototype.js",
-    "reason": "generators not implemented"
-  },
-  {
-    "source": "language/statements/class/subclass/builtin-objects/GeneratorFunction/regular-subclassing.js",
-    "reason": "generators not implemented"
-  },
+    // Eval problems
 
 
-  // Eval problems
+    {
+        "source": "language/expressions/super/prop-dot-cls-val-from-eval.js",
+        "reason": "JavaScriptParser cannot handle direct 'super.property' script code"
+    },
 
 
-  {
-    "source": "language/expressions/super/prop-dot-cls-val-from-eval.js",
-    "reason": "JavaScriptParser cannot handle direct 'super.property' script code"
-  },
+    {
+        "source": "language/expressions/super/prop-dot-obj-val-from-eval.js",
+        "reason": "JavaScriptParser cannot handle direct 'super.property' script code"
+    },
 
 
-  {
-    "source": "language/expressions/super/prop-dot-obj-val-from-eval.js",
-    "reason": "JavaScriptParser cannot handle direct 'super.property' script code"
-  },
+    {
+        "source": "language/expressions/super/prop-expr-cls-val-from-eval.js",
+        "reason": "JavaScriptParser cannot handle direct 'super.property' script code"
+    },
 
 
-  {
-    "source": "language/expressions/super/prop-expr-cls-val-from-eval.js",
-    "reason": "JavaScriptParser cannot handle direct 'super.property' script code"
-  },
+    {
+        "source": "language/expressions/super/prop-expr-obj-val-from-eval.js",
+        "reason": "JavaScriptParser cannot handle direct 'super.property' script code"
+    },
 
 
-  {
-    "source": "language/expressions/super/prop-expr-obj-val-from-eval.js",
-    "reason": "JavaScriptParser cannot handle direct 'super.property' script code"
-  },
+    // Esprima problems
 
 
-  // Esprima problems
-
-  {
-    "source": "language/expressions/object/method-definition/name-super-prop-param.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "language/expressions/optional-chaining/member-expression.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "language/statements/for-of/dstr-obj-id-init-let.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "language/statements/for/head-lhs-let.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "language/expressions/object/yield-non-strict-access.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "language/expressions/object/yield-non-strict-syntax.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "built-ins/RegExp/prototype/source/value-u.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "built-ins/RegExp/prototype/source/value-line-terminator.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "built-ins/RegExp/S15.10.2.13_A1_T1.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "built-ins/RegExp/S15.10.2.13_A1_T17.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "built-ins/RegExp/S15.10.2.13_A1_T2.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "built-ins/RegExp/S15.10.2.13_A2_T1.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "built-ins/RegExp/S15.10.2.13_A2_T2.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "built-ins/RegExp/S15.10.2.13_A2_T8.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "language/expressions/object/let-non-strict-access.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "language/expressions/object/let-non-strict-syntax.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "language/expressions/assignment/dstr-obj-id-identifier-yield-ident-valid.js",
-    "reason": "Esprima problem"
-  },
-  {
-    "source": "language/statements/for-of/dstr-obj-id-identifier-yield-ident-valid.js",
-    "reason": "Esprima problem"
-  }
+    {
+        "source": "language/expressions/object/method-definition/name-super-prop-param.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "language/expressions/optional-chaining/member-expression.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "language/statements/for-of/dstr-obj-id-init-let.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "language/statements/for/head-lhs-let.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "language/expressions/object/yield-non-strict-access.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "language/expressions/object/yield-non-strict-syntax.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "built-ins/RegExp/prototype/source/value-u.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "built-ins/RegExp/prototype/source/value-line-terminator.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "built-ins/RegExp/S15.10.2.13_A1_T1.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "built-ins/RegExp/S15.10.2.13_A1_T17.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "built-ins/RegExp/S15.10.2.13_A1_T2.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "built-ins/RegExp/S15.10.2.13_A2_T1.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "built-ins/RegExp/S15.10.2.13_A2_T2.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "built-ins/RegExp/S15.10.2.13_A2_T8.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "language/expressions/object/let-non-strict-access.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "language/expressions/object/let-non-strict-syntax.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "language/expressions/assignment/dstr-obj-id-identifier-yield-ident-valid.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "language/statements/for-of/dstr-obj-id-identifier-yield-ident-valid.js",
+        "reason": "Esprima problem"
+    },
+    {
+        "source": "language/white-space/mongolian-vowel-separator-eval.js",
+        "reason": "Esprima problem"
+    }
 ]
 ]

+ 67 - 0
Jint.Tests/Runtime/UnicodeTests.cs

@@ -0,0 +1,67 @@
+using System;
+using Jint.Runtime;
+using Xunit;
+
+namespace Jint.Tests.Runtime
+{
+    public class UnicodeTests
+    {
+        private readonly Engine _engine;
+
+        public UnicodeTests()
+        {
+            _engine = new Engine()
+                    .SetValue("log", new Action<object>(Console.WriteLine))
+                    .SetValue("assert", new Action<bool>(Assert.True))
+                    .SetValue("equal", new Action<object, object>(Assert.Equal));
+        }
+
+        private void RunTest(string source)
+        {
+            _engine.Execute(source);
+        }
+
+        [Fact]
+        public void EscapeUnicodeUnits()
+        {
+            var value = _engine.Evaluate(@"var a = '\uD83D\uDE80'; return a;").AsString();
+            Assert.Equal("🚀", value);
+        }
+
+        [Fact]
+        public void EscapeUnicodeEscaped()
+        {
+            var value = _engine.Evaluate(@"var a = '\u{1F680}'; return a;").AsString();
+            Assert.Equal("🚀", value);
+        }
+
+        [Fact]
+        public void UnicodeIdentifiers()
+        {
+            var value = _engine.Evaluate(@"const hello = 123; return hell\u{6F}").AsNumber();
+            Assert.Equal(123, value);
+        }
+
+        [Fact]
+        public void RegexDontParseUnicodeEscapesWithoutFlag()
+        {
+            var value = _engine.Evaluate(@"return /^\u{3}$/.test('uuu')").AsBoolean();
+            Assert.True(value);
+        }
+
+        [Fact]
+        public void RegexParseUnicodeEscapesWithFlag()
+        {
+            var value = _engine.Evaluate(@"return /^\u{3}$/u.test('uuu')").AsBoolean();
+            Assert.False(value);
+        }
+
+        [Fact]
+        public void RegexParseUnicodeDoesntChangeSource()
+        {
+            var value = _engine.Evaluate(@"return /a\u0041/.source").AsString();
+            Assert.Equal("a\\u0041", value);
+        }
+        
+    }
+}

+ 1 - 1
Jint/Jint.csproj

@@ -8,7 +8,7 @@
     <IsPackable>true</IsPackable>
     <IsPackable>true</IsPackable>
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Esprima" Version="2.1.0" />
+    <PackageReference Include="Esprima" Version="2.1.2" />
     <PackageReference Include="IsExternalInit" Version="1.0.1" PrivateAssets="all" />
     <PackageReference Include="IsExternalInit" Version="1.0.1" PrivateAssets="all" />
     <PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />
     <PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />
   </ItemGroup>
   </ItemGroup>

+ 3 - 3
Jint/Native/RegExp/RegExpConstructor.cs

@@ -106,7 +106,7 @@ namespace Jint.Native.RegExp
                 var scanner = new Scanner("/" + p + "/" + flags , new ParserOptions { AdaptRegexp = true });
                 var scanner = new Scanner("/" + p + "/" + flags , new ParserOptions { AdaptRegexp = true });
 
 
                 // seems valid
                 // seems valid
-                r.Value = scanner.TestRegExp(p, f);
+                r.Value = scanner.ParseRegex(p, f);
 
 
                 var timeout = _engine.Options.Constraints.RegexTimeout;
                 var timeout = _engine.Options.Constraints.RegexTimeout;
                 if (timeout.Ticks > 0)
                 if (timeout.Ticks > 0)
@@ -136,13 +136,13 @@ namespace Jint.Native.RegExp
             return r;
             return r;
         }
         }
 
 
-        public RegExpInstance Construct(Regex regExp, string flags)
+        public RegExpInstance Construct(Regex regExp, string source, string flags)
         {
         {
             var r = new RegExpInstance(Engine);
             var r = new RegExpInstance(Engine);
             r._prototype = PrototypeObject;
             r._prototype = PrototypeObject;
 
 
             r.Flags = flags;
             r.Flags = flags;
-            r.Source = regExp?.ToString();
+            r.Source = source;
 
 
             var timeout = _engine.Options.Constraints.RegexTimeout;
             var timeout = _engine.Options.Constraints.RegexTimeout;
             if (timeout.Ticks > 0)
             if (timeout.Ticks > 0)

+ 1 - 1
Jint/Runtime/Interop/DefaultObjectConverter.cs

@@ -31,7 +31,7 @@ namespace Jint
             { typeof(ulong), (engine, v) => JsNumber.Create((ulong)v) },
             { typeof(ulong), (engine, v) => JsNumber.Create((ulong)v) },
             {
             {
                 typeof(System.Text.RegularExpressions.Regex),
                 typeof(System.Text.RegularExpressions.Regex),
-                (engine, v) => engine.Realm.Intrinsics.RegExp.Construct((System.Text.RegularExpressions.Regex)v, "")
+                (engine, v) => engine.Realm.Intrinsics.RegExp.Construct((System.Text.RegularExpressions.Regex)v, ((System.Text.RegularExpressions.Regex)v).ToString(), "")
             }
             }
         };
         };
 
 

+ 1 - 1
Jint/Runtime/Interpreter/Expressions/JintLiteralExpression.cs

@@ -72,7 +72,7 @@ namespace Jint.Runtime.Interpreter.Expressions
             var expression = (Literal) _expression;
             var expression = (Literal) _expression;
             if (expression.TokenType == TokenType.RegularExpression)
             if (expression.TokenType == TokenType.RegularExpression)
             {
             {
-                return context.Engine.Realm.Intrinsics.RegExp.Construct((System.Text.RegularExpressions.Regex) expression.Value, expression.Regex.Flags);
+                return context.Engine.Realm.Intrinsics.RegExp.Construct((System.Text.RegularExpressions.Regex) expression.Value, expression.Regex.Pattern, expression.Regex.Flags);
             }
             }
 
 
             return JsValue.FromObject(context.Engine, expression.Value);
             return JsValue.FromObject(context.Engine, expression.Value);

+ 1 - 1
README.md

@@ -44,7 +44,7 @@ The entire execution engine was rebuild with performance in mind, in many cases
 - ✔ Symbols
 - ✔ Symbols
 - ❌ Tail calls
 - ❌ Tail calls
 - ✔ Typed arrays
 - ✔ Typed arrays
--  Unicode
+-  Unicode
 - ✔ Weakmap and Weakset
 - ✔ Weakmap and Weakset
 
 
 #### ECMAScript 2016
 #### ECMAScript 2016