mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-30 04:40:58 +00:00
21 lines
582 B
JavaScript
21 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");
|
||
|
|
});
|