@@ -44,7 +44,10 @@ export function merge(a: TemplateOpts, b: TemplateOpts): TemplateOpts {
|
||||
} = b;
|
||||
|
||||
return {
|
||||
parser: Object.assign({}, a.parser, b.parser),
|
||||
parser: {
|
||||
...a.parser,
|
||||
...b.parser,
|
||||
},
|
||||
placeholderWhitelist,
|
||||
placeholderPattern,
|
||||
preserveComments,
|
||||
|
||||
@@ -134,14 +134,12 @@ type MetadataState = {
|
||||
};
|
||||
|
||||
function parseWithCodeFrame(code: string, parserOpts: {}): BabelNodeFile {
|
||||
parserOpts = Object.assign(
|
||||
{
|
||||
allowReturnOutsideFunction: true,
|
||||
allowSuperOutsideMethod: true,
|
||||
sourceType: "module",
|
||||
},
|
||||
parserOpts,
|
||||
);
|
||||
parserOpts = {
|
||||
allowReturnOutsideFunction: true,
|
||||
allowSuperOutsideMethod: true,
|
||||
sourceType: "module",
|
||||
...parserOpts,
|
||||
};
|
||||
|
||||
try {
|
||||
return parse(code, parserOpts);
|
||||
|
||||
Reference in New Issue
Block a user