From bb952fe0b953fae910203c518b03c2d0c15b8a0a Mon Sep 17 00:00:00 2001 From: pngwn Date: Sun, 30 Aug 2020 23:29:16 +0100 Subject: [PATCH] cleanup --- src/compiler/parse/read/script.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/compiler/parse/read/script.ts b/src/compiler/parse/read/script.ts index e7b5e14cee..3fadab9fbe 100644 --- a/src/compiler/parse/read/script.ts +++ b/src/compiler/parse/read/script.ts @@ -3,8 +3,6 @@ import { Parser } from '../index'; import { Script } from '../../interfaces'; import { Node, Program } from 'estree'; -// const script_closing_tag = ''; - function get_context(parser: Parser, attributes: any[], start: number): string { const context = attributes.find(attribute => attribute.name === 'context'); if (!context) return 'default'; @@ -28,12 +26,9 @@ function get_context(parser: Parser, attributes: any[], start: number): string { return value; } - -const RE_SCRIPT_END = /<\/script\s*>/; - export default function read_script(parser: Parser, start: number, attributes: Node[]): Script { const script_start = parser.index; - const script_end = RE_SCRIPT_END.exec(parser.template.slice(script_start)); + const script_end = /<\/script\s*>/.exec(parser.template.slice(script_start)); if (!script_end) parser.error({ code: `unclosed-script`,