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

Button and Input created with empty constructor crash page #430

Open
lemniscate8 opened this issue Jun 19, 2021 · 0 comments
Open

Button and Input created with empty constructor crash page #430

lemniscate8 opened this issue Jun 19, 2021 · 0 comments

Comments

@lemniscate8
Copy link
Collaborator

lemniscate8 commented Jun 19, 2021

The Bug
Creating a button using the empty constructor is allowed but crashes a page.

To Reproduce
Here's some code:

#include "emp/web/web.hpp"
#include "emp/web/Button.hpp"

emp::web::Document doc("emp_base");
emp::web::Button button1([]() { 
  std::cout << "I don't work anymore!"; 
  }, "button1");
emp::web::Button button2; // He he, going to break everything
emp::web::Button button3([]() { 
  std::cout << "I don't even load. (Can't click meeeee!)"; 
  }, "button3");

int main() {
  doc << button1;
  doc << button2; // Does not render and breaks everything after it
  doc << button3;
}

Expected behavior
Shouldn't break everything or should generate a compiler error. But buttons without a callback would be useful. Maybe refactor to require an href at least and disable empty constructor?

Toolchain:

  • OS: Mac
  • Compiler: Emscripten 1.38.48
  • Browser Chrome
  • Empirical Version [e.g. the current master version, or a commit id]

Additional context
Gives the following error in console:
Uncaught abort(15). Build with -s ASSERTIONS=1 for more info.

@lemniscate8 lemniscate8 changed the title Button created with empty constructor crashes page Button and Input created with empty constructor crashes page Jun 30, 2021
@lemniscate8 lemniscate8 changed the title Button and Input created with empty constructor crashes page Button and Input created with empty constructor crash page Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant