mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-29 20:30:58 +00:00
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
|
|
test("Proxied constructor should handle argument_buffer reallocation during prototype get()", () => {
|
||
|
|
function foo() {}
|
||
|
|
|
||
|
|
let handler = {
|
||
|
|
get() {
|
||
|
|
// prettier-ignore
|
||
|
|
foo(
|
||
|
|
// make extra sure we trigger a reallocation
|
||
|
|
0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
|
||
|
|
0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
|
||
|
|
0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
|
||
|
|
0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
|
||
|
|
0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
|
||
|
|
0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
|
||
|
|
0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
|
||
|
|
0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
|
||
|
|
0x41, 0x41, 0x41, 0x41, 0x41, 0x41,
|
||
|
|
0x41, 0x41, 0x41, 0x41, 0x41, 0x41
|
||
|
|
);
|
||
|
|
|
||
|
|
return null;
|
||
|
|
},
|
||
|
|
};
|
||
|
|
|
||
|
|
function Construct() {
|
||
|
|
// later use dangling pointer
|
||
|
|
console.log(arguments);
|
||
|
|
}
|
||
|
|
|
||
|
|
let ConstructProxy = new Proxy(Construct, handler);
|
||
|
|
|
||
|
|
new ConstructProxy(0x1);
|
||
|
|
});
|