{"action":"created","issue":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/1611","repository_url":"https://api.github.com/repos/paperjs/paper.js","labels_url":"https://api.github.com/repos/paperjs/paper.js/issues/1611/labels{/name}","comments_url":"https://api.github.com/repos/paperjs/paper.js/issues/1611/comments","events_url":"https://api.github.com/repos/paperjs/paper.js/issues/1611/events","html_url":"https://github.com/paperjs/paper.js/issues/1611","id":383060484,"node_id":"MDU6SXNzdWUzODMwNjA0ODQ=","number":1611,"title":"PaperScript chokes on condensed expression","user":{"login":"lehni","id":213275,"node_id":"MDQ6VXNlcjIxMzI3NQ==","avatar_url":"https://avatars3.githubusercontent.com/u/213275?v=4","gravatar_id":"","url":"https://api.github.com/users/lehni","html_url":"https://github.com/lehni","followers_url":"https://api.github.com/users/lehni/followers","following_url":"https://api.github.com/users/lehni/following{/other_user}","gists_url":"https://api.github.com/users/lehni/gists{/gist_id}","starred_url":"https://api.github.com/users/lehni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lehni/subscriptions","organizations_url":"https://api.github.com/users/lehni/orgs","repos_url":"https://api.github.com/users/lehni/repos","events_url":"https://api.github.com/users/lehni/events{/privacy}","received_events_url":"https://api.github.com/users/lehni/received_events","type":"User","site_admin":false},"labels":[{"id":311722974,"node_id":"MDU6TGFiZWwzMTE3MjI5NzQ=","url":"https://api.github.com/repos/paperjs/paper.js/labels/cat:%20paper-script","name":"cat: paper-script","color":"c7def8","default":false},{"id":308791692,"node_id":"MDU6TGFiZWwzMDg3OTE2OTI=","url":"https://api.github.com/repos/paperjs/paper.js/labels/type:%20bug","name":"type: bug","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-21T10:49:53Z","updated_at":"2018-11-21T12:43:52Z","closed_at":null,"author_association":"MEMBER","body":"Code:\r\n```js\r\nfunction easeInOutQuint(t) {\r\n  return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t\r\n}\r\n```\r\nError:\r\n```\r\nLine 2: Uncaught ReferenceError: Invalid left-hand side in assignment\r\n```\r\nSketch:\r\nhttp://sketch.paperjs.org/#V/0.11.8/S/q1bKS8xNVbJSCs5OLUnOUNJRSs5PAfHTSvOSSzLz8xRSE4tTPfP8S0sCSzPzSjRKNBWqY/IUFIpSS0qL8hRKFGwUDPRMFewVDM0UtIBcdGylYKigDZHU1cWQjsmrjckDWppUlJqYXZAPtKBYySo6thYA"},"comment":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/comments/440649758","html_url":"https://github.com/paperjs/paper.js/issues/1611#issuecomment-440649758","issue_url":"https://api.github.com/repos/paperjs/paper.js/issues/1611","id":440649758,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDY0OTc1OA==","user":{"login":"sasensi","id":11247504,"node_id":"MDQ6VXNlcjExMjQ3NTA0","avatar_url":"https://avatars0.githubusercontent.com/u/11247504?v=4","gravatar_id":"","url":"https://api.github.com/users/sasensi","html_url":"https://github.com/sasensi","followers_url":"https://api.github.com/users/sasensi/followers","following_url":"https://api.github.com/users/sasensi/following{/other_user}","gists_url":"https://api.github.com/users/sasensi/gists{/gist_id}","starred_url":"https://api.github.com/users/sasensi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sasensi/subscriptions","organizations_url":"https://api.github.com/users/sasensi/orgs","repos_url":"https://api.github.com/users/sasensi/repos","events_url":"https://api.github.com/users/sasensi/events{/privacy}","received_events_url":"https://api.github.com/users/sasensi/received_events","type":"User","site_admin":false},"created_at":"2018-11-21T12:43:52Z","updated_at":"2018-11-21T12:43:52Z","author_association":"CONTRIBUTOR","body":"This issue can be reduced to [this](http://sketch.paperjs.org/#V/0.11.8/S/q1bKS8xNVbJSCs5OLUnOUNJRSs5PAfHLEosUKhRsFQytY4pi8pLz84rzc1L1cvLTNQwVtBR0dSs0rYGKk4pSE7ML8jPzSoqVrKJjawE=):\r\n```javascript\r\nvar x = 1;\r\nconsole.log(1 * --x);\r\n```\r\n\r\nHere is the explanation of what happen during compilation:\r\n```javascript\r\nvar code = 'var x = 1; console.log(1 * --x);';\r\nvar compiled = paper.PaperScript.compile(code, paper);\r\n\r\nconsole.log('compiled', compiled.code);\r\n// output: var x = 1; console.log(1 * x = __$__(x, \"-\", 1));\r\n\r\neval(code);\r\n// output: 0\r\n\r\npaper.PaperScript.execute(compiled, paper);\r\n// output: Uncaught ReferenceError: Invalid left-hand side in assignment\r\n```\r\n\r\nCode should be compiled as:\r\n```javascript\r\nvar x = 1; x = __$__(x, \"-\", 1); console.log(1 * x);\r\n```\r\ninstead of:\r\n```javascript\r\nvar x = 1; console.log(1 * x = __$__(x, \"-\", 1));\r\n```\r\n\r\nThis issue seems highly related (as the opposite problem) to #1450."}}
{"actor":{"display_login":"sasensi"}}