type: NodeTypes.COMPOUND_EXPRESSION,
children: [{ content: `Math` }, `.`, { content: `max` }, `(1, 2)`]
})
+
+ expect(
+ (parseWithExpressionTransform(`{{ new Error() }}`) as InterpolationNode)
+ .content
+ ).toMatchObject({
+ type: NodeTypes.COMPOUND_EXPRESSION,
+ children: ['new ', { content: 'Error' }, '()']
+ })
})
test('should not prefix reserved literals', () => {
const GLOBALS_ALLOWED =
'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
- 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console'
+ 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error'
export const isGloballyAllowed = /*#__PURE__*/ makeMap(GLOBALS_ALLOWED)