Using dev build of Sublime (3153)
Scope of some code in built-in JS implementation

Same file and location with the Babel package:

This behavior is correct. The export default form requires a trailing semicolon. In this example, there is no semicolon, so the syntax will assume that the exported expression continues until it reaches either a semicolon, an unexpected character, or a lookahead indicating that the automatic semicolon insertion algorithm would add a semicolon. A related example:
export default {
foo: 42
}
/* some comment */
['foo'];
This will export 42. The line ['foo'] is not an array literal, but a property access. See this comment for more details.
Previous versions of the JavaScript syntax handled this incorrectly, resulting in a number of bugs. PR #1009 restructured the syntax definition so that it would systematically do the right thing in these sorts of cases. Unfortunately, the Vue syntax assumes that when the closing </script> tag is encountered, the JavaScript syntax will only have the main scope on the stack. The Vue syntax will have to be modified to handle embedded JavaScript correctly.
@skyronic Since we've sorted out the Vue stuff, can this issue be closed?
This appears to be resolved now
Most helpful comment
This behavior is correct. The
export defaultform requires a trailing semicolon. In this example, there is no semicolon, so the syntax will assume that the exported expression continues until it reaches either a semicolon, an unexpected character, or a lookahead indicating that the automatic semicolon insertion algorithm would add a semicolon. A related example:This will export
42. The line['foo']is not an array literal, but a property access. See this comment for more details.Previous versions of the JavaScript syntax handled this incorrectly, resulting in a number of bugs. PR #1009 restructured the syntax definition so that it would systematically do the right thing in these sorts of cases. Unfortunately, the Vue syntax assumes that when the closing
</script>tag is encountered, the JavaScript syntax will only have themainscope on the stack. The Vue syntax will have to be modified to handle embedded JavaScript correctly.