Skip to content

How swc handle UTF-8 string #7701

Closed Answered by kdy1
Solo-steven asked this question in Q&A
Jul 24, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

let cm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
let (handler, errors) = self::string_errors::new_handler(cm.clone(), treat_err_as_bug);
let result = swc_common::GLOBALS.set(&swc_common::Globals::new(), || op(cm, handler));

let fm = cm.load_file(&path).expect("failed to load file");

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Solo-steven
Comment options

@kdy1
Comment options

@Solo-steven
Comment options

Answer selected by kdy1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants