Friday, 11 May 2018

Code from 9.x not working in 10.x. Hoping for discussion and advice

Possibly the code was illegal syntax to start with, but happened to work OK up until now (pre node 10). If the syntax is in fact legal, it's worth making a node issue about it on Github.str_arr_mapify can almost be ignored here - it allows a function to be called with an array of strings rather than single ones and be executed multiple times.The error I get is SyntaxError: 'super' keyword unexpected hereThe code:var core_extension = str_arr_mapify(function (tagName) { jsgui[tagName] = class extends Control { 'constructor' (spec) { super(spec); this.dom.tagName = tagName; } }; jsgui[tagName].prototype._tag_name = tagName; map_Controls[tagName] = jsgui[tagName]; }); The problem may come from treating a class that gets defined here as just another variable. Am I allowed to do this, but V8 or node is broken, or is it successfully noticing my invalid syntax?

Submitted May 11, 2018 at 12:02PM by jsgui

No comments:

Post a Comment