1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:07:34 +00:00

LibJS: Disallow duplicated variable declarations

This commit is contained in:
davidot 2021-07-12 01:29:47 +02:00 committed by Andreas Kling
parent 5cc518f07a
commit 40b8689f9b
4 changed files with 62 additions and 4 deletions

View file

@ -15,12 +15,12 @@ test("basic functionality", () => {
});
test("casts |this| to string", () => {
const it = String.prototype[Symbol.iterator].call(45);
let it = String.prototype[Symbol.iterator].call(45);
expect(it.next()).toEqual({ value: "4", done: false });
expect(it.next()).toEqual({ value: "5", done: false });
expect(it.next()).toEqual({ value: undefined, done: true });
const it = String.prototype[Symbol.iterator].call(false);
it = String.prototype[Symbol.iterator].call(false);
expect(it.next()).toEqual({ value: "f", done: false });
expect(it.next()).toEqual({ value: "a", done: false });
expect(it.next()).toEqual({ value: "l", done: false });