diff options
author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2021-02-16 16:22:18 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-02-28 16:39:55 +0300 |
commit | a1ed78cb3ba653b3f76d9c1481e7033ba51ff88f (patch) | |
tree | 09b39cc77b251e72eef3709fe59070f4701c254b /test | |
parent | 856d20b77289b9dd7c3d890ef82b89b55fb9e2fe (diff) |
module: improve support of data: URLs
Add support for loading modules using percent-encoded URLs.
PR-URL: https://github.com/nodejs/node/pull/37392
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Bradley Farias <bradley.meck@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/es-module/test-esm-data-urls.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/es-module/test-esm-data-urls.js b/test/es-module/test-esm-data-urls.js index 61da442c9e0..282aaf1857a 100644 --- a/test/es-module/test-esm-data-urls.js +++ b/test/es-module/test-esm-data-urls.js @@ -102,4 +102,9 @@ function createBase64URL(mime, body) { assert.strictEqual(e.code, 'ERR_INVALID_RETURN_PROPERTY_VALUE'); } } + { + const plainESMURL = 'data:text/javascript,export%20default%202'; + const module = await import(plainESMURL); + assert.strictEqual(module.default, 2); + } })().then(common.mustCall()); |