-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use WHATWG's URL to implement all of source-map's URL operations. (#371)
* Use WHATWG's URL to implement all of source-map's URL operations. * Preserve string-concat sources behavior for absolute-path sources. * Only use whatwg-url in browser builds. * Optimize perf to avoid new URL where not strictly needed. * Cache url -> source index lookups in the consumer. * Simplify url cache size limiting.
- Loading branch information
1 parent
23104f3
commit 02f3d6b
Showing
7 changed files
with
387 additions
and
427 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* -*- Mode: js; js-indent-level: 2; -*- */ | ||
/* | ||
* Copyright 2011 Mozilla Foundation and contributors | ||
* Licensed under the New BSD license. See LICENSE or: | ||
* http://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
"use strict"; | ||
|
||
/** | ||
* Browser 'URL' implementations have been found to handle non-standard URL | ||
* schemes poorly, and schemes like | ||
* | ||
* webpack:///src/folder/file.js | ||
* | ||
* are very common in source maps. For the time being we use a JS | ||
* implementation in these contexts instead. See | ||
* | ||
* * https://bugzilla.mozilla.org/show_bug.cgi?id=1374505 | ||
* * https://bugs.chromium.org/p/chromium/issues/detail?id=734880 | ||
*/ | ||
module.exports = require("whatwg-url").URL; |
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,13 @@ | ||
/* -*- Mode: js; js-indent-level: 2; -*- */ | ||
/* | ||
* Copyright 2011 Mozilla Foundation and contributors | ||
* Licensed under the New BSD license. See LICENSE or: | ||
* http://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
"use strict"; | ||
|
||
// Note: This file is overridden in the 'package.json#browser' field to | ||
// substitute lib/url-browser.js instead. | ||
|
||
// Use the URL global for Node 10, and the 'url' module for Node 8. | ||
module.exports = typeof URL === "function" ? URL : require("url").URL; |
Oops, something went wrong.