mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:38:12 +00:00
LibJS: Allow "delete someGlobalVariable"
This is solved by allowing Identifier nodes to produce a Reference with the global object as base.
This commit is contained in:
parent
67b8e6fc5b
commit
3c4a9e421f
6 changed files with 54 additions and 0 deletions
16
Libraries/LibJS/Tests/delete-global-variable.js
Normal file
16
Libraries/LibJS/Tests/delete-global-variable.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
load("test-common.js");
|
||||
|
||||
try {
|
||||
a = 1;
|
||||
assert(delete a === true);
|
||||
|
||||
assertThrowsError(() => {
|
||||
a;
|
||||
}, {
|
||||
error: ReferenceError
|
||||
});
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue