P5.js-web-editor: Print dialog appears when calling print on undefined variables

Created on 6 Apr 2018  路  4Comments  路  Source: processing/p5.js-web-editor

Nature of issue?

  • [x] Found a bug
  • [ ] Existing feature enhancement
  • [ ] New feature request

Details about the bug:

Calling print(x) with an undefined variable brings up the browser print dialog. I noticed that there was a similar issue over on https://github.com/processing/p5.js-web-editor/issues/474 but that seemed to be more focused on calling print outside of setup or draw. In this case, it just happens if a variable becomes undefined.

One of my students stumbled across this by accidentally providing the dist function without enough parameters let x = dist(10, 35), which ended up returning undefined.

  • Web browser and version: Chrome/Firefox/Safari
  • Operating System: MacOSX 10.12.6
  • Steps to reproduce this: Alpha editor link
bug

Most helpful comment

posted in processing/p5.js#2765

All 4 comments

thanks for submitting this! i want to try this in a different code editor to make sure this is not an issue with p5.js but with the editor.

EDIT: this also happens in codepen (https://codepen.io/girlfriends/pen/GxwJZa) so maybe this is a p5.js issue?

EDIT2: i tried downloading the sketch and just serving the project using http-server. it still happens, so I'm fairly sure this is a p5.js issue.

posted in processing/p5.js#2765

Thanks! I should have checked there first >_<

no worries! it's not always easy to figure out an issue is with the editor or p5.js itself.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

willingc picture willingc  路  5Comments

andytilia picture andytilia  路  4Comments

catarak picture catarak  路  5Comments

AltoRetrato picture AltoRetrato  路  4Comments

runemadsen picture runemadsen  路  5Comments