From 9b1997b8b6f82e17e42c43aae3621e2b932f5843 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Mon, 8 Jul 2019 09:55:24 +0200 Subject: core: clearly define when module lookup is path-based vs URL-based The rules are now as follows: * In `import` statements, as mandated by the WHATWG specification, the import specifier is always treated as a URL. If it is a relative URL, it must start with either / or ./ or ../ * A script name passed to deno as a command line argument may be either an absolute URL or a local path. - If the name starts with a valid URI scheme followed by a colon, e.g. 'http:', 'https:', 'file:', 'foo+bar:', it always interpreted as a URL (even if Deno doesn't support the indicated protocol). - Otherwise, the script name is interpreted as a local path. The local path may be relative, and operating system semantics determine how it is resolved. Prefixing a relative path with ./ is not required. --- tests/error_011_bad_module_specifier.ts.out | 2 +- tests/error_012_bad_dynamic_import_specifier.ts.out | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/error_011_bad_module_specifier.ts.out b/tests/error_011_bad_module_specifier.ts.out index d5a3efd7e..9eec89307 100644 --- a/tests/error_011_bad_module_specifier.ts.out +++ b/tests/error_011_bad_module_specifier.ts.out @@ -1,4 +1,4 @@ -[WILDCARD]error: Uncaught ImportPathPrefixMissing: relative import path not prefixed with / or ./ or ../ +[WILDCARD]error: Uncaught ImportPrefixMissing: relative import path not prefixed with / or ./ or ../ [WILDCARD] js/errors.ts:[WILDCARD] at DenoError (js/errors.ts:[WILDCARD]) at maybeError (js/errors.ts:[WILDCARD]) diff --git a/tests/error_012_bad_dynamic_import_specifier.ts.out b/tests/error_012_bad_dynamic_import_specifier.ts.out index 1a20b60a1..3f88b4ee3 100644 --- a/tests/error_012_bad_dynamic_import_specifier.ts.out +++ b/tests/error_012_bad_dynamic_import_specifier.ts.out @@ -1,4 +1,4 @@ -[WILDCARD]error: Uncaught ImportPathPrefixMissing: relative import path not prefixed with / or ./ or ../ +[WILDCARD]error: Uncaught ImportPrefixMissing: relative import path not prefixed with / or ./ or ../ [WILDCARD] js/errors.ts:[WILDCARD] at DenoError (js/errors.ts:[WILDCARD]) at maybeError (js/errors.ts:[WILDCARD]) -- cgit v1.2.3