-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow modules to import files with
.json
ext.
- Loading branch information
1 parent
d180999
commit 34ff5e4
Showing
3 changed files
with
22 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
test/fixtures/fake-test262/test/language/module-code/json-module.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (C) 2021 the V8 project authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
/*--- | ||
description: This is a test for loading files with a `.json` extension. | ||
esid: sec-parsemodule | ||
flags: [module] | ||
---*/ | ||
|
||
import './json-module_FIXTURE.json'; | ||
|
||
/** | ||
* At the time of this writing, neither the "import assertions" proposal [1] | ||
* nor the "JSON modules" proposal [2] are widely implemented. In order to | ||
* verify that the harness correctly identifies JSON dependencies without | ||
* requiring the new semantics, this test simply loads a JSON file which | ||
* happens to parse as JavaScript, and it does not validate the exported value. | ||
*/ |
1 change: 1 addition & 0 deletions
1
test/fixtures/fake-test262/test/language/module-code/json-module_FIXTURE.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"This file is valid JSON and valid JavaScript." |