2
0
Эх сурвалжийг харах

Implement export * as ns from module syntax
Also fix #5777
And minor syntax error message improvement

rhuanjl 7 жил өмнө
parent
commit
0e1e761384

+ 2 - 0
lib/Common/ConfigFlagsList.h

@@ -673,6 +673,7 @@ PHASE(All)
 #define DEFAULT_CONFIG_ES7ValuesEntries        (true)
 #define DEFAULT_CONFIG_ESObjectGetOwnPropertyDescriptors (true)
 #define DEFAULT_CONFIG_ESDynamicImport         (false)
+#define DEFAULT_CONFIG_ESExportNsAs            (true)
 
 #define DEFAULT_CONFIG_ESSharedArrayBuffer     (false)
 
@@ -1149,6 +1150,7 @@ FLAGPR           (Boolean, ES6, ES6UnicodeVerbose      , "Enable ES6 Unicode 6.0
 FLAGPR           (Boolean, ES6, ES6Unscopables         , "Enable ES6 With Statement Unscopables"                    , DEFAULT_CONFIG_ES6Unscopables)
 FLAGPR           (Boolean, ES6, ES6RegExSticky         , "Enable ES6 RegEx sticky flag"                             , DEFAULT_CONFIG_ES6RegExSticky)
 FLAGPR           (Boolean, ES6, ES2018RegExDotAll      , "Enable ES2018 RegEx dotAll flag"                          , DEFAULT_CONFIG_ES2018RegExDotAll)
+FLAGPR           (Boolean, ES6, ESExportNsAs           , "Enable ES experimental export * as name"                  , DEFAULT_CONFIG_ESExportNsAs)
 
 #ifndef COMPILE_DISABLE_ES6RegExPrototypeProperties
     #define COMPILE_DISABLE_ES6RegExPrototypeProperties 0

+ 54 - 6
lib/Parser/Parse.cpp

@@ -2366,12 +2366,12 @@ void Parser::ParseNamedImportOrExportClause(ModuleImportOrExportEntryList* impor
             // If we are parsing an import statement, the token after 'as' must be a BindingIdentifier.
             if (!isExportClause)
             {
-                ChkCurTokNoScan(tkID, ERRsyntax);
+                ChkCurTokNoScan(tkID, ERRValidIfFollowedBy, _u("'as'"), _u("an identifier."));
             }
 
             if (!(m_token.IsIdentifier() || m_token.IsReservedWord()))
             {
-                Error(ERRsyntax);
+                Error(ERRValidIfFollowedBy, _u("'as'"), _u("an identifier."));
             }
 
             identifierAs = m_token.GetIdentifier(this->GetHashTbl());
@@ -2496,7 +2496,7 @@ ModuleImportOrExportEntry* Parser::AddModuleImportOrExportEntry(ModuleImportOrEx
 {
     if (importOrExportEntry->exportName != nullptr)
     {
-        CheckForDuplicateExportEntry(importOrExportEntryList, importOrExportEntry->exportName);
+        CheckForDuplicateExportEntry(importOrExportEntry->exportName);
     }
 
     importOrExportEntryList->Prepend(*importOrExportEntry);
@@ -2526,6 +2526,19 @@ void Parser::AddModuleLocalExportEntry(ParseNodePtr varDeclNode)
     AddModuleImportOrExportEntry(EnsureModuleLocalExportEntryList(), nullptr, localName, localName, nullptr);
 }
 
+void Parser::CheckForDuplicateExportEntry(IdentPtr exportName)
+{
+    if (m_currentNodeProg->AsParseNodeModule()->indirectExportEntries != nullptr)
+    {
+        CheckForDuplicateExportEntry(m_currentNodeProg->AsParseNodeModule()->indirectExportEntries, exportName);
+    }
+
+    if (m_currentNodeProg->AsParseNodeModule()->localExportEntries != nullptr)
+    {
+       CheckForDuplicateExportEntry(m_currentNodeProg->AsParseNodeModule()->localExportEntries, exportName);
+    }
+}
+
 void Parser::CheckForDuplicateExportEntry(ModuleImportOrExportEntryList* exportEntryList, IdentPtr exportName)
 {
     ModuleImportOrExportEntry* findResult = exportEntryList->Find([&](ModuleImportOrExportEntry exportEntry)
@@ -2539,7 +2552,7 @@ void Parser::CheckForDuplicateExportEntry(ModuleImportOrExportEntryList* exportE
 
     if (findResult != nullptr)
     {
-        Error(ERRsyntax);
+        Error(ERRDuplicateExport, exportName->Psz());
     }
 }
 
@@ -2927,7 +2940,34 @@ ParseNodePtr Parser::ParseExportDeclaration(bool *needTerminator)
     switch (m_token.tk)
     {
     case tkStar:
+    {
         this->GetScanner()->Scan();
+        IdentPtr exportName = nullptr;
+
+        if (m_scriptContext->GetConfig()->IsESExportNsAsEnabled())
+        {
+            // export * as name
+            if (m_token.tk == tkID)
+            {
+                // check for 'as'
+                if (wellKnownPropertyPids.as == m_token.GetIdentifier(this->GetHashTbl()))
+                {
+                    // scan to the next token
+                    this->GetScanner()->Scan();
+
+                    // token after as must be an identifier
+                    if (!(m_token.IsIdentifier() || m_token.IsReservedWord()))
+                    {
+                        Error(ERRValidIfFollowedBy, _u("'as'"), _u("an identifier."));
+                    }
+
+                    exportName = m_token.GetIdentifier(this->GetHashTbl());
+                    
+                    // scan to next token
+                    this->GetScanner()->Scan();
+                }
+            }
+        }
 
         // A star token in an export declaration must be followed by a from clause which begins with a token 'from'.
         moduleIdentifier = ParseImportOrExportFromClause<buildAST>(true);
@@ -2937,9 +2977,16 @@ ParseNodePtr Parser::ParseExportDeclaration(bool *needTerminator)
             Assert(moduleIdentifier != nullptr);
 
             AddModuleSpecifier(moduleIdentifier);
-            IdentPtr importName = wellKnownPropertyPids._star;
 
-            AddModuleImportOrExportEntry(EnsureModuleStarExportEntryList(), importName, nullptr, nullptr, moduleIdentifier);
+            if (!exportName)
+            {
+                AddModuleImportOrExportEntry(EnsureModuleStarExportEntryList(), wellKnownPropertyPids._star, nullptr, nullptr, moduleIdentifier);
+            }
+            else
+            {
+                CheckForDuplicateExportEntry(exportName);
+                AddModuleImportOrExportEntry(EnsureModuleIndirectExportEntryList(), wellKnownPropertyPids._star, nullptr, exportName, moduleIdentifier);
+            }
         }
 
         if (needTerminator != nullptr)
@@ -2948,6 +2995,7 @@ ParseNodePtr Parser::ParseExportDeclaration(bool *needTerminator)
         }
 
         break;
+    }
 
     case tkLCurly:
     {

+ 3 - 2
lib/Parser/Parse.h

@@ -645,6 +645,7 @@ protected:
     ModuleImportOrExportEntry* AddModuleImportOrExportEntry(ModuleImportOrExportEntryList* importOrExportEntryList, IdentPtr importName, IdentPtr localName, IdentPtr exportName, IdentPtr moduleRequest);
     ModuleImportOrExportEntry* AddModuleImportOrExportEntry(ModuleImportOrExportEntryList* importOrExportEntryList, ModuleImportOrExportEntry* importOrExportEntry);
     void AddModuleLocalExportEntry(ParseNodePtr varDeclNode);
+    void CheckForDuplicateExportEntry(IdentPtr exportName);
     void CheckForDuplicateExportEntry(ModuleImportOrExportEntryList* exportEntryList, IdentPtr exportName);
 
     ParseNodeVar * CreateModuleImportDeclNode(IdentPtr localName);
@@ -1087,11 +1088,11 @@ private:
     void AddToNodeList(ParseNode ** ppnodeList, ParseNode *** pppnodeLast, ParseNode * pnodeAdd);
     void AddToNodeListEscapedUse(ParseNode ** ppnodeList, ParseNode *** pppnodeLast, ParseNode * pnodeAdd);
 
-    void ChkCurTokNoScan(int tk, int wErr)
+    void ChkCurTokNoScan(int tk, int wErr, LPCWSTR stringOne = _u(""), LPCWSTR stringTwo = _u(""))
     {
         if (m_token.tk != tk)
         {
-            Error(wErr);
+            Error(wErr, stringOne, stringTwo);
         }
     }
 

+ 1 - 0
lib/Parser/perrors.h

@@ -110,6 +110,7 @@ LSC_ERROR_MSG(1094, ERRLabelFollowedByEOF, "Unexpected end of script after a lab
 LSC_ERROR_MSG(1095, ERRFunctionAfterLabelInStrict, "Function declarations not allowed after a label in strict mode.")
 LSC_ERROR_MSG(1096, ERRAwaitAsLabelInAsync, "Use of 'await' as label in async function is not allowed.")
 LSC_ERROR_MSG(1097, ERRExperimental, "Use of disabled experimental feature")
+LSC_ERROR_MSG(1098, ERRDuplicateExport, "Duplicate export of name '%s'")
 //1098-1199 available for future use
 
 // Generic errors intended to be re-usable

+ 1 - 0
lib/Runtime/Base/ThreadConfigFlagsList.h

@@ -48,6 +48,7 @@ FLAG_RELEASE(IsESObjectGetOwnPropertyDescriptorsEnabled, ESObjectGetOwnPropertyD
 FLAG_RELEASE(IsESSharedArrayBufferEnabled, ESSharedArrayBuffer)
 FLAG_RELEASE(IsESDynamicImportEnabled, ESDynamicImport)
 FLAG_RELEASE(IsESBigIntEnabled, ESBigInt)
+FLAG_RELEASE(IsESExportNsAsEnabled, ESExportNsAs)
 #ifdef ENABLE_PROJECTION
 FLAG(AreWinRTDelegatesInterfaces, WinRTDelegateInterfaces)
 FLAG_RELEASE(IsWinRTAdaptiveAppsEnabled, WinRTAdaptiveApps)

+ 6 - 0
lib/Runtime/Language/ModuleNamespace.cpp

@@ -272,6 +272,12 @@ namespace Js
             // TODO: maybe we can cache the slot address & offset, instead of looking up everytime? We do need to look up the reference everytime.
             if (unambiguousNonLocalExports->TryGetValue(propertyId, &moduleNameRecord))
             {
+                // special case for export * as ns
+                if (moduleNameRecord.bindingName == Js::PropertyIds::star_)
+                {
+                    *value = static_cast<Var>(moduleNameRecord.module->GetNamespace());
+                    return PropertyQueryFlags::Property_Found;
+                }
                 return JavascriptConversion::BooleanToPropertyQueryFlags(moduleNameRecord.module->GetNamespace()->GetProperty(originalInstance, moduleNameRecord.bindingName, value, info, requestContext));
             }
         }

+ 21 - 17
lib/Runtime/Language/SourceTextModuleRecord.cpp

@@ -634,22 +634,25 @@ namespace Js
                 {
                     JavascriptError::ThrowReferenceError(scriptContext, JSERR_CannotResolveModule, exportEntry.moduleRequest->Psz());
                 }
-                else
+
+                if (exportEntry.importName->GetPropertyId() == PropertyIds::star_)
                 {
-                    isAmbiguous = !childModuleRecord->ResolveExport(importNameId, resolveSet, exportRecord);
-                    if (isAmbiguous)
-                    {
-                        // ambiguous; don't need to search further
-                        return true;
-                    }
-                    else
-                    {
-                        // found a resolution. done;
-                        if (*exportRecord != nullptr)
-                        {
-                            return true;
-                        }
-                    }
+                    // export * as someName from "foo"
+                    *exportRecord = childModuleRecord->GetNamespaceNameRecord();
+                    return true;
+                }
+
+                isAmbiguous = !childModuleRecord->ResolveExport(importNameId, resolveSet, exportRecord);
+                if (isAmbiguous)
+                {
+                    // ambiguous; don't need to search further
+                    return true;
+                }
+
+                // found a resolution. done;
+                if (*exportRecord != nullptr)
+                {
+                    return true;
                 }
                 return false;
             });
@@ -1211,8 +1214,9 @@ namespace Js
                     this->errorObject = errorObj;
                     return;
                 }
-                if (!childModuleRecord->ResolveExport(propertyId, nullptr, &exportRecord) ||
-                    (exportRecord == nullptr))
+                if (propertyId != PropertyIds::star_ &&
+                    (!childModuleRecord->ResolveExport(propertyId, nullptr, &exportRecord) ||
+                    (exportRecord == nullptr)))
                 {
                     JavascriptError* errorObj = scriptContext->GetLibrary()->CreateSyntaxError();
                     JavascriptError::SetErrorMessage(errorObj, JSERR_ModuleResolveExport, exportEntry.exportName->Psz(), scriptContext);

+ 23 - 0
test/es6module/bug_issue_5777.js

@@ -0,0 +1,23 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+// Bug Issue 5777 https://github.com/Microsoft/ChakraCore/issues/5777
+// Duplicate export names should cause an early syntax error
+
+WScript.RegisterModuleSource("a.js",
+    `export const boo = 4;
+    export {bar as boo} from "b.js";
+    print ("Should not be printed")`);
+WScript.RegisterModuleSource("b.js","export const bar = 5;");
+
+import("a.js").then(()=>{
+    print("Failed - expected SyntaxError but no error thrown")
+}).catch ((e)=>{
+    if (e instanceof SyntaxError) {
+        print("pass");
+    } else {
+        print (`Failed - threw ${e.constructor.toString()} but should have thrown SyntaxError`);
+    }
+});

+ 134 - 0
test/es6module/export_namespace_as.js

@@ -0,0 +1,134 @@
+//-------------------------------------------------------------------------------------------------------
+// Copyright (C) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
+//-------------------------------------------------------------------------------------------------------
+
+WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
+
+
+const tests = [
+    {
+        name: "Basic usage of export * as ns",
+        body() {
+            WScript.RegisterModuleSource("basicExport", 'export * as basic from "ModuleSimpleExport.js"');
+
+            testRunner.LoadModule(
+                `import {basic} from "basicExport";
+                assert.areEqual(basic.ModuleSimpleExport_foo(), 'ModuleSimpleExport');`);
+        }
+    },
+    {
+        name: "Various valid exports via export * as ns",
+        body() {
+            WScript.RegisterModuleSource("variousExports", `
+                export * as basic from "ModuleSimpleExport.js";
+                export * as valid from "ValidExportStatements.js";
+                export * as validReExports from "ValidReExportStatements.js";
+                export * as complexReExports from "ModuleComplexReexports.js";
+                `);
+            
+                testRunner.LoadModule(`
+                function verifyPropertyDesc(obj, prop, desc, propName) {
+                    var actualDesc = Object.getOwnPropertyDescriptor(obj, prop);
+                    if (typeof propName === "undefined") { propName = prop; }
+                    assert.areEqual(desc.configurable, actualDesc.configurable, propName+"'s attribute: configurable");
+                    assert.areEqual(desc.enumerable, actualDesc.enumerable, propName+"'s attribute: enumerable");
+                    assert.areEqual(desc.writable, actualDesc.writable, propName+"'s attribute: writable");
+                }
+
+                import {basic, valid as foo, validReExports as foo1} from "variousExports";
+
+                assert.areEqual(basic.ModuleSimpleExport_foo(), 'ModuleSimpleExport');
+
+                assert.areEqual("Module", foo[Symbol.toStringTag], "@@toStringTag is the String value'Module'");
+                verifyPropertyDesc(foo, Symbol.toStringTag, {configurable:false, enumerable: false, writable: false}, "Symbol.toStringTag");
+                verifyPropertyDesc(foo, "default", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "var7", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "var6", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "var4", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "var3", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "var2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "var1", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "foo4", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "bar2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "foobar", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "foo3", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "baz2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "foo2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "baz", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "bar", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "foo", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "const6", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "const5", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "const4", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "const3", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "const2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "let7", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "let6", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "let5", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "let4", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "let2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "let1", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "cl2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "cl1", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "gn2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "gn1", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "fn2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo, "fn1", {configurable:false, enumerable: true, writable: true});
+    
+                verifyPropertyDesc(foo1, "foo", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo1, "bar", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo1, "baz", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo1, "foo2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo1, "bar2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo1, "foo3", {configurable:false, enumerable: true, writable: true});
+    
+                import {complexReExports as foo2} from "variousExports";
+                verifyPropertyDesc(foo2, "ModuleComplexReexports_foo", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo2, "bar2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo2, "localfoo2", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo2, "bar", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo2, "localfoo", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo2, "baz", {configurable:false, enumerable: true, writable: true});
+                verifyPropertyDesc(foo2, "foo", {configurable:false, enumerable: true, writable: true});
+            `);
+        }
+    },
+    {
+        name : "Re-exported namespace",
+        body() {
+            WScript.RegisterModuleSource("one",`
+                export function foo () { return "foo"; }
+                export function bar () { return "bar"; }
+                export const boo = 5;
+                `);
+            WScript.RegisterModuleSource("two", `
+                export const boo = 6;
+                export function foo() { return "far"; }
+                `);
+            WScript.RegisterModuleSource("three", `
+                export * as ns from "two";
+                export * as default from "one";
+                `);
+            WScript.RegisterModuleSource("four", `
+                export * from "three";
+            `);
+            testRunner.LoadModule(`
+                import main from "three";
+                import {ns} from "three";
+                import * as Boo from "four";
+
+                assert.areEqual(main.foo(), "foo");
+                assert.areEqual(main.bar(), "bar");
+                assert.areEqual(main.boo, 5);
+
+                assert.areEqual(ns.foo(), "far");
+                assert.areEqual(ns.boo, 6);
+                assert.areEqual(Boo.ns, ns);
+                assert.isUndefined(Boo.default);
+            `);
+        }
+    }
+];
+
+testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });

+ 200 - 193
test/es6module/rlexe.xml

@@ -1,193 +1,200 @@
-<?xml version="1.0" encoding="utf-8"?>
-<regress-exe>
-  <test>
-    <default>
-      <files>test001.js</files>
-      <baseline/>
-      <compile-flags>-PrintSystemException  -es6module -es6generators -es7asyncawait -ArrayMutationTestSeed:456986689  -maxinterpretcount:1 -maxsimplejitruncount:2 -MinMemOpCount:0 -werexceptionsupport  -bgjit- -loopinterpretcount:1 -off:lossyinttypespec</compile-flags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>test002.js</files>
-      <baseline/>
-      <compile-flags>-PrintSystemException  -es6module -es6generators -es7asyncawait -ArrayMutationTestSeed:1580332815  -maxinterpretcount:1 -maxsimplejitruncount:2 -MinMemOpCount:0 -werexceptionsupport  -MinSwitchJumpTableSize:3 -MaxLinearStringCaseCount:2 -MaxLinearIntCaseCount:2 -force:fieldcopyprop -force:rejit -UseJITTrampoline- -force:fixdataprops -off:stackargopt -force:atom -oopjit- -force:ScriptFunctionWithInlineCache -off:lossyinttypespec -ForceArrayBTree -off:trackintusage -ForceJITCFGCheck -ForceStaticInterpreterThunk -off:cachedScope -off:DelayCapture -off:fefixedmethods -off:ArrayCheckHoist</compile-flags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>moduletest1.js</files>
-      <compile-flags>-ES6Module</compile-flags>
-      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>moduletest2.js</files>
-      <compile-flags>-ES6Module</compile-flags>
-      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>module-syntax.js</files>
-      <compile-flags>-MuteHostErrorMsg -ES6Module -args summary -endargs</compile-flags>
-      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>module-syntax1.js</files>
-      <compile-flags>-ES6Module -args summary -endargs</compile-flags>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>module-functionality.js</files>
-      <compile-flags>-MuteHostErrorMsg -ES6Module -args summary -endargs</compile-flags>
-      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>moduleUrlInError.js</files>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>dynamic-module-functionality.js</files>
-        <compile-flags>-ES6Module -ESDynamicImport -args summary -endargs</compile-flags>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>dynamic-module-import-specifier.js</files>
-        <compile-flags>-MuteHostErrorMsg -ES6Module -ESDynamicImport -args summary -endargs</compile-flags>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>module-syntax.js</files>
-      <compile-flags>-MuteHostErrorMsg -ES6Module -force:deferparse -args summary -endargs</compile-flags>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>module-syntax1.js</files>
-      <compile-flags>-ES6Module -force:deferparse -args summary -endargs</compile-flags>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>module-namespace.js</files>
-      <compile-flags>-ES6Module -Es6ToStringTag -args summary -endargs</compile-flags>
-      <tags>exclude_dynapogo,exclude_drt,exclude_sanitize_address,exclude_noicu</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>module-bugfixes.js</files>
-      <compile-flags>-MuteHostErrorMsg -ES6Module -args summary -endargs</compile-flags>
-      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>exportBindingLoader.js</files>
-      <compile-flags>-ES6Module -args summary -endargs</compile-flags>
-      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>exportBindingLoader.js</files>
-      <compile-flags>-ES6Module -args summary -endargs</compile-flags>
-      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>test_bug_2645.js</files>
-      <compile-flags>-ES6Module</compile-flags>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>bug_OS12095746.js</files>
-        <compile-flags>-MuteHostErrorMsg -IgnoreScriptErrorCode -TraceHostCallback -ES6Module -ESDynamicImport</compile-flags>
-      <tags>exclude_dynapogo,exclude_sanitize_address,exclude_drt</tags>
-      <baseline>bug_OS12095746.baseline</baseline>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>bug_OS14562349.js</files>
-      <compile-flags>-ESDynamicImport -args summary -endargs</compile-flags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>bug_issue_3076.js</files>
-    <compile-flags>-force:deferparse -ESDynamicImport</compile-flags>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>bug_issue_3257.js</files>
-      <compile-flags>-ESDynamicImport</compile-flags>
-      <baseline>bug_issue_3257.baseline</baseline>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-    <test>
-    <default>
-      <files>multiple-roots-circular.js</files>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>GetModuleNamespace.js</files>
-      <compile-flags>-ESDynamicImport</compile-flags>
-      <tags>exclude_jshost,exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>module-load-twice.js</files>
-      <!-- This test is designed for ch only. -->
-      <!-- todo: enable using source code copy for jshost? -->
-      <tags>exclude_jshost</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>passmodule.js</files>
-      <!-- This test is designed for ch only - to test the -module flag. -->
-      <compile-flags>-module</compile-flags>
-      <tags>exclude_jshost</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>bug_OS17830745.js</files>
-      <compile-flags>-MuteHostErrorMsg</compile-flags>
-      <tags>exclude_sanitize_address</tags>
-    </default>
-  </test>
-  <test>
-    <default>
-      <files>bug_OS18460517.js</files>
-      <baseline>bug_OS18460517.baseline</baseline>
-      <compile-flags>-maxinterpretcount:1 -maxsimplejitruncount:2 -force:rejit</compile-flags>
-    </default>
-  </test>
-</regress-exe>
+<?xml version="1.0" encoding="utf-8"?>
+<regress-exe>
+  <test>
+    <default>
+      <files>test001.js</files>
+      <baseline/>
+      <compile-flags>-PrintSystemException  -es6module -es6generators -es7asyncawait -ArrayMutationTestSeed:456986689  -maxinterpretcount:1 -maxsimplejitruncount:2 -MinMemOpCount:0 -werexceptionsupport  -bgjit- -loopinterpretcount:1 -off:lossyinttypespec</compile-flags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>test002.js</files>
+      <baseline/>
+      <compile-flags>-PrintSystemException  -es6module -es6generators -es7asyncawait -ArrayMutationTestSeed:1580332815  -maxinterpretcount:1 -maxsimplejitruncount:2 -MinMemOpCount:0 -werexceptionsupport  -MinSwitchJumpTableSize:3 -MaxLinearStringCaseCount:2 -MaxLinearIntCaseCount:2 -force:fieldcopyprop -force:rejit -UseJITTrampoline- -force:fixdataprops -off:stackargopt -force:atom -oopjit- -force:ScriptFunctionWithInlineCache -off:lossyinttypespec -ForceArrayBTree -off:trackintusage -ForceJITCFGCheck -ForceStaticInterpreterThunk -off:cachedScope -off:DelayCapture -off:fefixedmethods -off:ArrayCheckHoist</compile-flags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>moduletest1.js</files>
+      <compile-flags>-ES6Module</compile-flags>
+      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>moduletest2.js</files>
+      <compile-flags>-ES6Module</compile-flags>
+      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>module-syntax.js</files>
+      <compile-flags>-MuteHostErrorMsg -ES6Module -args summary -endargs</compile-flags>
+      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>module-syntax1.js</files>
+      <compile-flags>-ES6Module -args summary -endargs</compile-flags>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>module-functionality.js</files>
+      <compile-flags>-MuteHostErrorMsg -ES6Module -args summary -endargs</compile-flags>
+      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>moduleUrlInError.js</files>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>dynamic-module-functionality.js</files>
+        <compile-flags>-ES6Module -ESDynamicImport -args summary -endargs</compile-flags>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>dynamic-module-import-specifier.js</files>
+        <compile-flags>-MuteHostErrorMsg -ES6Module -ESDynamicImport -args summary -endargs</compile-flags>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>module-syntax.js</files>
+      <compile-flags>-MuteHostErrorMsg -ES6Module -force:deferparse -args summary -endargs</compile-flags>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>module-syntax1.js</files>
+      <compile-flags>-ES6Module -force:deferparse -args summary -endargs</compile-flags>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>module-namespace.js</files>
+      <compile-flags>-ES6Module -Es6ToStringTag -args summary -endargs</compile-flags>
+      <tags>exclude_dynapogo,exclude_drt,exclude_sanitize_address,exclude_noicu</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>module-bugfixes.js</files>
+      <compile-flags>-MuteHostErrorMsg -ES6Module -args summary -endargs</compile-flags>
+      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>exportBindingLoader.js</files>
+      <compile-flags>-ES6Module -args summary -endargs</compile-flags>
+      <tags>exclude_dynapogo,exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>test_bug_2645.js</files>
+      <compile-flags>-ES6Module</compile-flags>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>bug_OS12095746.js</files>
+        <compile-flags>-MuteHostErrorMsg -IgnoreScriptErrorCode -TraceHostCallback -ES6Module -ESDynamicImport</compile-flags>
+      <tags>exclude_dynapogo,exclude_sanitize_address,exclude_drt</tags>
+      <baseline>bug_OS12095746.baseline</baseline>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>bug_OS14562349.js</files>
+      <compile-flags>-ESDynamicImport -args summary -endargs</compile-flags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>bug_issue_3076.js</files>
+    <compile-flags>-force:deferparse -ESDynamicImport</compile-flags>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>bug_issue_3257.js</files>
+      <compile-flags>-ESDynamicImport</compile-flags>
+      <baseline>bug_issue_3257.baseline</baseline>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>bug_issue_5777.js</files>
+      <compile-flags>-ESDynamicImport -MuteHostErrorMsg</compile-flags>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>export_namespace_as.js</files>
+      <compile-flags>-ESExportNsAs -MuteHostErrorMsg -args summary -endargs</compile-flags>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+    <test>
+    <default>
+      <files>multiple-roots-circular.js</files>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>GetModuleNamespace.js</files>
+      <compile-flags>-ESDynamicImport</compile-flags>
+      <tags>exclude_jshost,exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>module-load-twice.js</files>
+      <!-- This test is designed for ch only. -->
+      <!-- todo: enable using source code copy for jshost? -->
+      <tags>exclude_jshost</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>passmodule.js</files>
+      <!-- This test is designed for ch only - to test the -module flag. -->
+      <compile-flags>-module</compile-flags>
+      <tags>exclude_jshost</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>bug_OS17830745.js</files>
+      <compile-flags>-MuteHostErrorMsg</compile-flags>
+      <tags>exclude_sanitize_address</tags>
+    </default>
+  </test>
+  <test>
+    <default>
+      <files>bug_OS18460517.js</files>
+      <baseline>bug_OS18460517.baseline</baseline>
+      <compile-flags>-maxinterpretcount:1 -maxsimplejitruncount:2 -force:rejit</compile-flags>
+    </default>
+  </test>
+</regress-exe>