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

saveTable issue #5006

Closed
1 of 17 tasks
PandaBalls opened this issue Jan 23, 2021 · 5 comments · Fixed by #5013
Closed
1 of 17 tasks

saveTable issue #5006

PandaBalls opened this issue Jan 23, 2021 · 5 comments · Fixed by #5013
Labels

Comments

@PandaBalls
Copy link
Contributor

Most appropriate sub-area of p5.js?

  • Accessibility (Web Accessibility)
  • Build tools and processes
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Friendly error system
  • Image
  • IO (Input/Output)
  • Localization
  • Math
  • Unit Testing
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Details about the bug:

loadTable as table,
table.set() some values,
print(table) looks fine.
But saveTable(table) throw this error:

p5.min.js:3 Uncaught TypeError: e.rows[l].arr[u].includes is not a function
    at _.y.default.saveTable (p5.min.js:3)
    at <anonymous>:1:1
@PandaBalls PandaBalls added the Bug label Jan 23, 2021
@PandaBalls
Copy link
Contributor Author

only happened in p5.vscode.
It works fine in Processing Desktop IDE

@PandaBalls
Copy link
Contributor Author

I tested with 2 version of p5.mini.js
/*! p5.js v0.10.2 October 14, 2019 */ this works for me .
/*! p5.js v1.2.0 December 19, 2020 */ this will throw the error.

@limzykenneth
Copy link
Member

@PandaBalls Can you maybe share a sample sketch? You can set one up with the p5.js web editor then we can test with the same table data as you have if you like.

@PandaBalls
Copy link
Contributor Author

@PandaBalls Can you maybe share a sample sketch? You can set one up with the p5.js web editor then we can test with the same table data as you have if you like.

Here is the online editor version.
SaveTable issue

@limzykenneth
Copy link
Member

The checks on this line assumes the table element will be a string and calls a string function on it while it could be other types (numbers on your example) so it fails.

We could add an explicit typecast before that check to make sure everything is casted as a string before continuing, or we can add an additional check if the passed in value is string or not.

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

Successfully merging a pull request may close this issue.

2 participants