KanoComputing / kano-code

👩‍💻👨‍💻Kano Code
https://world.kano.me
GNU General Public License v2.0
16 stars 5 forks source link

Parts can be renamed to match toolbox categories #1808

Open keithclark opened 4 years ago

keithclark commented 4 years ago

If you rename a part to a name that already exists in the toolbox (i.e. Math) it:

pazdera commented 4 years ago

Thanks for bringing this up. We should prevent using names from the core library to avoid this.

keithclark commented 4 years ago

Ran into this again but this time with variables. While testing something I created a variable named time. For some reason the creation stopped working. Opening devtools reveled the following JavaScript error.

VM374:20 Uncaught TypeError: time.every is not a function
    at eval (eval at runInContext (index-7728810b.js:1), <anonymous>:20:8)
    at t.fire (emitter-0ed5874e.js:1)
    at ApplicationModule._start (index-7728810b.js:1)
    at ApplicationModule.executeLifecycleStep (index-7728810b.js:1)
    at index-7728810b.js:1
    at Array.forEach (<anonymous>)
    at AppModules._runModuleLifecycleStep (index-7728810b.js:1)
    at AppModules.afterRun (index-7728810b.js:1)
    at Runner._onRunningStateChange (index-7728810b.js:1)
    at index-7728810b.js:1

My variable overwrites with the time object used in the output JavaScript. This is what was produced by the editor:

var time;

time.every(1, 'frames', function() {
  ...
})