Skip to content

exporting variable as "var" throws exception #119

@keski

Description

@keski

Using the variable name var as an exported variable name throws an exception in the current version (see below):

"missing/invalid action definition for transaction - Uncaught SyntaxError: Unexpected token var - SyntaxError: Unexpected token var\n    at new Function (<anonymous>)"

This is not really a bug but an implementation limitation, caused by the fact that declared variables are represented literally as they are defined in queries (thus disallowing all javascript keywords from being used). A better alternative would therefore be to automatically add some export prefix. For example:

// encode variable "var"
let ___exported_var = ...;

Metadata

Metadata

Assignees

Labels

backlogKeep open for later (typically, not a problem for SPIRIT but maybe for other woo.sh projects)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions