properly coerce input code to string - fixes #1432
This commit is contained in:
parent
9e0cf84505
commit
e6326332b6
@ -53,7 +53,7 @@ export function transformFile(filename: string, opts?: Object, callback: Functio
|
|||||||
|
|
||||||
export function transformFileSync(filename: string, opts?: Object = {}) {
|
export function transformFileSync(filename: string, opts?: Object = {}) {
|
||||||
opts.filename = filename;
|
opts.filename = filename;
|
||||||
return transform(fs.readFileSync(filename), opts);
|
return transform(fs.readFileSync(filename, "utf8"), opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parse(code, opts = {}) {
|
export function parse(code, opts = {}) {
|
||||||
|
|||||||
@ -480,6 +480,8 @@ export default class File {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wrap(code, callback) {
|
wrap(code, callback) {
|
||||||
|
code = code + "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (this.shouldIgnore()) {
|
if (this.shouldIgnore()) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user