File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 99import * as colors from "./external/colors.ts" ;
1010import { MappedString } from "./text-types.ts" ;
1111import { ErrorLocation , TidyverseError } from "./errors-types.ts" ;
12- import { isWindows } from "../../deno_ral/platform.ts" ;
1312
1413// tidyverse error message styling
1514// https://style.tidyverse.org/error-messages.html
@@ -25,9 +24,19 @@ import { isWindows } from "../../deno_ral/platform.ts";
2524
2625function platformHasNonAsciiCharacters ( ) : boolean {
2726 try {
28- return ! isWindows ;
27+ // we can't import from deno_ral directly here
28+ // because it's outside of core/lib, which
29+ // gets imported by code that runs in the browser
30+ //
31+ // Then, we need to guard against Deno being undefined
32+ // there as well
33+ return Deno . build . os !== "windows" ;
2934 } catch ( _e ) {
30- return false ;
35+ //
36+ // But if deno is undefined, we can assume that we're
37+ // running in the browser, where non-ascii characters
38+ // are supported
39+ return true ;
3140 }
3241}
3342
You can’t perform that action at this time.
0 commit comments