Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parts can be renamed to match toolbox categories #1808

Open
keithclark opened this issue Jan 12, 2020 · 2 comments
Open

Parts can be renamed to match toolbox categories #1808

keithclark opened this issue Jan 12, 2020 · 2 comments

Comments

@keithclark
Copy link
Contributor

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

  • Breaks the toolbox UI for the Math item.
  • Breaks any code relying on Math blocks (e.g Lerp) because the functions now appear to map the newly renamed part, which doesn’t have a Lerp block.
@pazdera
Copy link
Contributor

pazdera commented Jan 15, 2020

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

@keithclark
Copy link
Contributor Author

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() {
  ...
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants