You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
lemniscate8
changed the title
Button created with empty constructor crashes page
Button and Input created with empty constructor crashes page
Jun 30, 2021
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
The Bug
Creating a button using the empty constructor is allowed but crashes a page.
To Reproduce
Here's some code:
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:
Additional context
Gives the following error in console:
Uncaught abort(15). Build with -s ASSERTIONS=1 for more info.
The text was updated successfully, but these errors were encountered: