mirror of
https://github.com/dart-lang/sdk
synced 2024-10-02 23:59:16 +00:00
Properly handle Windows file: URLs on Node.js (#30098)
This adds logic to the JS implementation of URI to determine whether the code is running on Windows under Node.js.
This commit is contained in:
parent
a7865761d4
commit
5a74d8ab09
|
@ -27,6 +27,10 @@
|
|||
the system level timeout duration, a timeout may occur sooner than specified
|
||||
in 'timeout'.
|
||||
|
||||
* `dart:core`
|
||||
* The `Uri` class now correctly handles paths while running on Node.js on
|
||||
Windows.
|
||||
|
||||
### Dart VM
|
||||
* Support for MIPS has been remvoed.
|
||||
|
||||
|
|
|
@ -602,7 +602,13 @@ class Uri {
|
|||
@patch
|
||||
class _Uri {
|
||||
@patch
|
||||
static bool get _isWindows => false;
|
||||
static bool get _isWindows => _isWindowsCached;
|
||||
|
||||
static final bool _isWindowsCached = JS(
|
||||
'bool',
|
||||
'typeof process != "undefined" && '
|
||||
'Object.prototype.toString.call(process) == "[object process]" && '
|
||||
'process.platform == "win32"');
|
||||
|
||||
// Matches a String that _uriEncodes to itself regardless of the kind of
|
||||
// component. This corresponds to [_unreservedTable], i.e. characters that
|
||||
|
|
|
@ -611,7 +611,13 @@ class Uri {
|
|||
@patch
|
||||
class _Uri {
|
||||
@patch
|
||||
static bool get _isWindows => false;
|
||||
static bool get _isWindows => _isWindowsCached;
|
||||
|
||||
static final bool _isWindowsCached = JS(
|
||||
'bool',
|
||||
'typeof process != "undefined" && '
|
||||
'Object.prototype.toString.call(process) == "[object process]" && '
|
||||
'process.platform == "win32"');
|
||||
|
||||
// Matches a String that _uriEncodes to itself regardless of the kind of
|
||||
// component. This corresponds to [_unreservedTable], i.e. characters that
|
||||
|
|
Loading…
Reference in a new issue