tests(cli): add test for improper unicode encoding (#8162)

and updates swc_ecma_codegen

Closes #8161
This commit is contained in:
Kitson Kelly 2020-11-23 10:22:13 +11:00 committed by GitHub
parent e7fc7d7151
commit fec7fdc691
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

4
Cargo.lock generated
View File

@ -2379,9 +2379,9 @@ dependencies = [
[[package]]
name = "swc_ecma_codegen"
version = "0.41.0"
version = "0.41.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c48486c086354a033f5e5c4a9dc730ad0e7596039dd4d92f70fe56fcfec4f26a"
checksum = "96e655391ee7b9e7e01fde2f64bfc1dbcf8b712510fc09edc6c00de52704e6a9"
dependencies = [
"bitflags",
"num-bigint",

View File

@ -1909,6 +1909,7 @@ pub mod tests {
("file:///tests/fixture12.ts", "fixture12.out"),
("file:///tests/fixture13.ts", "fixture13.out"),
("file:///tests/fixture14.ts", "fixture14.out"),
("file:///tests/fixture15.ts", "fixture15.out"),
];
let c = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
let fixtures = c.join("tests/bundle");

View File

@ -0,0 +1,3 @@
export function getIndex(c: string): number {
return "\x00\r\n\x85\u2028\u2029".indexOf(c);
}

View File

@ -0,0 +1,3 @@
export function getIndex(c) {
return "\x00\r\n\x85\u2028\u2029".indexOf(c);
}