You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Help us to manage our issues by answering the following:
Describe your issue:
When using the spread operator in my tag's script block, I get an error when compiling:
description: "Unexpected token ..."
index: 290
lineNumber: 21
column: 11
__proto__: Error: Line 21: Unexpected token ... at e.constructError (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:287660) at e.createError (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:287860) at e.unexpectedTokenError (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:225276) at e.throwUnexpectedToken (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:225480) at e.parseObjectPropertyKey (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:235331) at e.parseObjectProperty (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:235971) at e.parseObjectInitializer (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:237376) at e.inheritCoverGrammar (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:230191) at e.parsePrimaryExpression (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:232004) at e.inheritCoverGrammar (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:230191)
message: "Line 21: Unexpected token ..."
stack: "Error: Line 21: Unexpected token ...↵ at e.constructError (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:287660)↵ at e.createError (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:287860)↵ at e.unexpectedTokenError (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:225276)↵ at e.throwUnexpectedToken (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:225480)↵ at e.parseObjectPropertyKey (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:235331)↵ at e.parseObjectProperty (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:235971)↵ at e.parseObjectInitializer (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:237376)↵ at e.inheritCoverGrammar (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:230191)↵ at e.parsePrimaryExpression (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:232004)↵ at e.inheritCoverGrammar (https://cdn.jsdelivr.net/npm/riot@4/riot+compiler.min.js:1:230191)"
__proto__: Object
Can you reproduce the issue?
Reproduce by using the spread operator on objects within the script block for the tag:
onBeforeMount(props, state) {
const data = {
alpha: 'a',
beta: 'b',
gamma: 'g'
};
const data2 = {
delta: 'd',
epsilon: 'e'
};
// The use of spread here will cause the error.
const allData = {
... data,
... data2
};
}
I'm compiling tags via the rollup plugin (on Windows), but I have also been able to reproduce with the browser compiler (seen in example above). My stack is Gulp, Rollup, the Riot Rollup plugin, and the Babel Rollup plugin.
Which version of Riot does it affect?
Riot 4
How would you tag this issue?
Question
Bug
Discussion
Feature request
Tip
Enhancement
Performance
The text was updated successfully, but these errors were encountered:
Help us to manage our issues by answering the following:
When using the spread operator in my tag's script block, I get an error when compiling:
Reproduce by using the spread operator on objects within the script block for the tag:
Plunkr example of the bug
I'm compiling tags via the rollup plugin (on Windows), but I have also been able to reproduce with the browser compiler (seen in example above). My stack is Gulp, Rollup, the Riot Rollup plugin, and the Babel Rollup plugin.
Riot 4
The text was updated successfully, but these errors were encountered: