From 071cc92ab857d27aa3cbec0fa0c987f6b1a0d659 Mon Sep 17 00:00:00 2001 From: Chengzhong Wu Date: Thu, 17 Oct 2024 16:47:59 +0100 Subject: [PATCH] [source-phase-imports] update missing source error type --- .../import-source-source-text-module.case | 4 ++-- .../import-source-specifier-tostring.case | 4 ++-- ...ow-import-catch-import-source-source-text-module.js | 4 ++-- ...ow-import-catch-import-source-specifier-tostring.js | 4 ++-- ...-function-await-import-source-source-text-module.js | 4 ++-- ...-function-await-import-source-specifier-tostring.js | 4 ++-- ...on-return-await-import-source-source-text-module.js | 4 ++-- ...on-return-await-import-source-specifier-tostring.js | 4 ++-- ...-function-await-import-source-source-text-module.js | 4 ++-- ...-function-await-import-source-specifier-tostring.js | 4 ++-- ...-async-function-import-source-source-text-module.js | 4 ++-- ...-async-function-import-source-specifier-tostring.js | 4 ++-- ...on-return-await-import-source-source-text-module.js | 4 ++-- ...on-return-await-import-source-specifier-tostring.js | 4 ++-- ...async-gen-await-import-source-source-text-module.js | 4 ++-- ...async-gen-await-import-source-specifier-tostring.js | 4 ++-- ...en-return-await-import-source-source-text-module.js | 4 ++-- ...en-return-await-import-source-specifier-tostring.js | 4 ++-- ...ck-import-catch-import-source-source-text-module.js | 4 ++-- ...ck-import-catch-import-source-specifier-tostring.js | 4 ++-- ...d-block-labeled-import-source-source-text-module.js | 4 ++-- ...d-block-labeled-import-source-specifier-tostring.js | 4 ++-- ...nested-do-while-import-source-source-text-module.js | 4 ++-- ...nested-do-while-import-source-specifier-tostring.js | 4 ++-- ...se-import-catch-import-source-source-text-module.js | 4 ++-- ...se-import-catch-import-source-specifier-tostring.js | 4 ++-- ...on-import-catch-import-source-source-text-module.js | 4 ++-- ...on-import-catch-import-source-specifier-tostring.js | 4 ++-- ...if-import-catch-import-source-source-text-module.js | 4 ++-- ...if-import-catch-import-source-specifier-tostring.js | 4 ++-- ...le-import-catch-import-source-source-text-module.js | 4 ++-- ...le-import-catch-import-source-specifier-tostring.js | 4 ++-- ...el-import-catch-import-source-source-text-module.js | 4 ++-- ...el-import-catch-import-source-specifier-tostring.js | 4 ++-- .../import-source-source-text-module.js | 10 +++++----- 35 files changed, 73 insertions(+), 73 deletions(-) diff --git a/src/dynamic-import/import-source-source-text-module.case b/src/dynamic-import/import-source-source-text-module.case index c095051c81c..aa0bc5dbcd8 100644 --- a/src/dynamic-import/import-source-source-text-module.case +++ b/src/dynamic-import/import-source-source-text-module.case @@ -7,7 +7,7 @@ esid: sec-moduleevaluation info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -35,4 +35,4 @@ features: [source-phase-imports] //- import import.source('./empty_FIXTURE.js') //- body -assert.sameValue(error.name, 'ReferenceError'); +assert.sameValue(error.name, 'SyntaxError'); diff --git a/src/dynamic-import/import-source-specifier-tostring.case b/src/dynamic-import/import-source-specifier-tostring.case index ee9f23510bb..3c267c38c59 100644 --- a/src/dynamic-import/import-source-specifier-tostring.case +++ b/src/dynamic-import/import-source-specifier-tostring.case @@ -28,7 +28,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. template: catch features: [source-phase-imports] @@ -47,4 +47,4 @@ const obj = { //- import import.source(obj) //- body -assert.sameValue(error.name, 'ReferenceError'); +assert.sameValue(error.name, 'SyntaxError'); diff --git a/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-source-source-text-module.js index a1bc35872d6..8cae33cf198 100644 --- a/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -49,7 +49,7 @@ info: | let f = () => { import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); }; diff --git a/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-source-specifier-tostring.js index d7f2d7a92ea..cdaed9e77f9 100644 --- a/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -58,7 +58,7 @@ const obj = { let f = () => { import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); }; diff --git a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-source-source-text-module.js index 888349b405e..32818161559 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -52,6 +52,6 @@ const f = async () => { f().catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-source-specifier-tostring.js index be3fa4c1edd..856a1c9424e 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -61,6 +61,6 @@ const f = async () => { f().catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-source-source-text-module.js index 0ab1239e5c5..3f22645a5e7 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -50,6 +50,6 @@ const f = async () => await import.source('./empty_FIXTURE.js'); f().catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-source-specifier-tostring.js index 318ce701379..e4752afea06 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -59,6 +59,6 @@ const f = async () => await import.source(obj); f().catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-source-source-text-module.js index 2763bbae7db..6fab8470486 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -49,7 +49,7 @@ info: | async function f() { await import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-source-specifier-tostring.js index fb14fb661ec..f06701a6698 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -58,7 +58,7 @@ const obj = { async function f() { await import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-async-function-import-source-source-text-module.js index 78460b35949..33f2b6ada74 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-function-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -49,7 +49,7 @@ info: | async function f() { import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-async-function-import-source-specifier-tostring.js index a0e98387111..0c2705e8264 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-function-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -58,7 +58,7 @@ const obj = { async function f() { import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-source-source-text-module.js index bee973034df..a87207ffe97 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -49,7 +49,7 @@ info: | async function f() { return await import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-source-specifier-tostring.js index 96256180f71..5280e170190 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -58,7 +58,7 @@ const obj = { async function f() { return await import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-source-source-text-module.js index 043fddfa366..d6dedb88842 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -52,6 +52,6 @@ async function * f() { f().next().catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-source-specifier-tostring.js index 3ce755aef04..2c6036c0aa7 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -61,6 +61,6 @@ async function * f() { f().next().catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-source-source-text-module.js index 2288aacb4fb..06bbf35a4f5 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -52,6 +52,6 @@ async function * f() { f().next().catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-source-specifier-tostring.js index cbac8793a4b..9234cb9ad2e 100644 --- a/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -61,6 +61,6 @@ async function * f() { f().next().catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-source-source-text-module.js index d482cd39359..ff862471af4 100644 --- a/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -49,7 +49,7 @@ info: | { import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); }; diff --git a/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-source-specifier-tostring.js index fc5b7a69211..c967f08fcc9 100644 --- a/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -58,7 +58,7 @@ const obj = { { import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); }; diff --git a/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-source-source-text-module.js index 0708790c9d4..9e750f033b4 100644 --- a/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -49,7 +49,7 @@ info: | label: { import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); }; diff --git a/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-source-specifier-tostring.js index 294af99722d..526173bcfac 100644 --- a/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -58,7 +58,7 @@ const obj = { label: { import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); }; diff --git a/test/language/expressions/dynamic-import/catch/nested-do-while-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-do-while-import-source-source-text-module.js index e6adfdfcd8d..2ea1466c4e2 100644 --- a/test/language/expressions/dynamic-import/catch/nested-do-while-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-do-while-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -49,7 +49,7 @@ info: | do { import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } while (false); diff --git a/test/language/expressions/dynamic-import/catch/nested-do-while-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-do-while-import-source-specifier-tostring.js index 0690a317f0a..9fa2133e7b1 100644 --- a/test/language/expressions/dynamic-import/catch/nested-do-while-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-do-while-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -58,7 +58,7 @@ const obj = { do { import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } while (false); diff --git a/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-source-source-text-module.js index 2afab9e6f5e..0a09f0e6c49 100644 --- a/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -51,7 +51,7 @@ if (false) { } else { import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-source-specifier-tostring.js index b3d08022818..c874ccc4a10 100644 --- a/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -60,7 +60,7 @@ if (false) { } else { import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-source-source-text-module.js index 9117f41c5ca..aa92b8a8d73 100644 --- a/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -49,7 +49,7 @@ info: | function f() { import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-source-specifier-tostring.js index 72f2a077569..937401568ed 100644 --- a/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -58,7 +58,7 @@ const obj = { function f() { import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-source-source-text-module.js index 793ff344ea7..81748f0d4e7 100644 --- a/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -49,7 +49,7 @@ info: | if (true) { import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-source-specifier-tostring.js index 7808d69806f..b676d79015e 100644 --- a/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -58,7 +58,7 @@ const obj = { if (true) { import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); } diff --git a/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-source-source-text-module.js index e2ec2077111..8be48ee6ab5 100644 --- a/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -51,7 +51,7 @@ while (!x) { x++; import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); }; diff --git a/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-source-specifier-tostring.js index 2886633ea96..645a75e373e 100644 --- a/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -60,7 +60,7 @@ while (!x) { x++; import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); }; diff --git a/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-source-source-text-module.js b/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-source-source-text-module.js index 9ba2397f2ca..6fcbfa6d1f8 100644 --- a/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-source-source-text-module.js +++ b/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-source-source-text-module.js @@ -23,7 +23,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. Import Calls @@ -48,6 +48,6 @@ info: | import.source('./empty_FIXTURE.js').catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-source-specifier-tostring.js b/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-source-specifier-tostring.js index c08ec3d442f..62e29fe3e48 100644 --- a/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-source-specifier-tostring.js +++ b/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-source-specifier-tostring.js @@ -42,7 +42,7 @@ info: | 16.2.1.7.2 GetModuleSource ( ) Source Text Module Record provides a GetModuleSource implementation that always returns an abrupt completion indicating that a source phase import is not available. - 1. Throw a ReferenceError exception. + 1. Throw a SyntaxError exception. ---*/ // The following case is equivalent of the call of: @@ -57,6 +57,6 @@ const obj = { import.source(obj).catch(error => { - assert.sameValue(error.name, 'ReferenceError'); + assert.sameValue(error.name, 'SyntaxError'); }).then($DONE, $DONE); diff --git a/test/staging/source-phase-imports/import-source-source-text-module.js b/test/staging/source-phase-imports/import-source-source-text-module.js index b0743969795..0c1dd86b01d 100644 --- a/test/staging/source-phase-imports/import-source-source-text-module.js +++ b/test/staging/source-phase-imports/import-source-source-text-module.js @@ -3,7 +3,7 @@ // found in the LICENSE file. /*--- description: > - GetModuleSource of SourceTextModule throws a ReferenceError. + GetModuleSource of SourceTextModule throws a SyntaxError. esid: sec-source-text-module-record-getmodulesource features: [source-phase-imports] flags: [async] @@ -12,13 +12,13 @@ includes: [asyncHelpers.js] asyncTest(async function () { await assert.throwsAsync( - ReferenceError, + SyntaxError, () => import.source('./modules-simple_FIXTURE.js'), - "Promise should be rejected with ReferenceError"); + "Promise should be rejected with SyntaxError"); // Import a module that has a source phase import. await assert.throwsAsync( - ReferenceError, + SyntaxError, () => import('./modules-import-source_FIXTURE.js'), - "Promise should be rejected with ReferenceError in indirect import source"); + "Promise should be rejected with SyntaxError in indirect import source"); });