mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
20 lines
582 B
JavaScript
20 lines
582 B
JavaScript
test("Don't crash when throwing exception inside a callee smaller than the caller", () => {
|
|
function make() {
|
|
let o = {};
|
|
Object.defineProperty(o, "go", {
|
|
get: function () {
|
|
return doesNotExist;
|
|
},
|
|
});
|
|
return o;
|
|
}
|
|
|
|
// Some nonsense to make sure this function has a longer bytecode than the throwing getter.
|
|
function x() {
|
|
return 3;
|
|
}
|
|
function b() {}
|
|
b(x() + x() + x());
|
|
|
|
expect(() => make().go()).toThrowWithMessage(ReferenceError, "'doesNotExist' is not defined");
|
|
});
|