This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make clutz support Closure's BROWSER_WITH_TRANSFORMED_PREFIXES resolu…
…tion. Previously, clutz would throw when encountering an es6 file with absolute import. Closure has support for such paths along with an option to rewrite them to something rooted using the BROWSER_WITH_TRANSFORMED_PREFIXES module resolution strategy. This change makes clutz use that strategy and makes it so that one can configure which absolute prefixes will be replaced with '/'. Note, this is still not proper support for ES6, but rather just making sure clutz doesn't reject code that Closure could accept using the right flags.
- Loading branch information
Showing
4 changed files
with
29 additions
and
0 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
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
Empty file.
10 changes: 10 additions & 0 deletions
10
src/test/java/com/google/javascript/clutz/partial/es6_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,10 @@ | ||
import * as rel from './rel/module/name'; | ||
import * as rel2 from '/abs/module/name'; | ||
//!! abs_strip_for_testing is special cased in the test harness. | ||
import * as abs from 'abs_strip_for_testing/module/name'; | ||
|
||
export let x = rel.x + abs.x + rel2.x; | ||
|
||
//!! The emit of this file is intentionally empty. | ||
//!! So far clutz doesn't support es6 modules properly, but the test | ||
//!! makes sure that it doesn't reject them either. |