prevent unclosed <script> causing infinite loop

pull/435/head
Rich-Harris 8 years ago
parent fc646925db
commit 05ea031895

@ -7,6 +7,8 @@ export default function readScript ( parser, start, attributes ) {
const scriptStart = parser.index;
const scriptEnd = parser.template.indexOf( scriptClosingTag, scriptStart );
if ( scriptEnd === -1 ) parser.error( `<script> must have a closing tag` );
const source = spaces( scriptStart ) + parser.template.slice( scriptStart, scriptEnd );
parser.index = scriptEnd + scriptClosingTag.length;

@ -0,0 +1,8 @@
{
"message": "<script> must have a closing tag",
"loc": {
"line": 3,
"column": 8
},
"pos": 34
}

@ -0,0 +1,3 @@
<h1>Hello {{name}}!</h1>
<script>
Loading…
Cancel
Save