From 7be30916c0bd8e4eb464fc6535b1e0a4ed6d9e3d Mon Sep 17 00:00:00 2001 From: fireboltofdeath <24422634+Fireboltofdeath@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:02:18 -0400 Subject: [PATCH 1/2] Fix isReservedIdentifier --- src/LuauAST/util/isReservedIdentifier.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LuauAST/util/isReservedIdentifier.ts b/src/LuauAST/util/isReservedIdentifier.ts index 57d0f1c..ae43f08 100644 --- a/src/LuauAST/util/isReservedIdentifier.ts +++ b/src/LuauAST/util/isReservedIdentifier.ts @@ -1,5 +1,5 @@ import { globals } from "LuauAST/impl/globals"; export function isReservedIdentifier(id: string) { - return id in globals; + return globals.hasOwnProperty(id); } From 6d8f578dd49d3ed72493b5ed2adf1bb2da2d43f3 Mon Sep 17 00:00:00 2001 From: fireboltofdeath <24422634+Fireboltofdeath@users.noreply.github.com> Date: Tue, 26 Sep 2023 16:07:09 -0400 Subject: [PATCH 2/2] Use explicit prototype --- src/LuauAST/util/isReservedIdentifier.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LuauAST/util/isReservedIdentifier.ts b/src/LuauAST/util/isReservedIdentifier.ts index ae43f08..76d900e 100644 --- a/src/LuauAST/util/isReservedIdentifier.ts +++ b/src/LuauAST/util/isReservedIdentifier.ts @@ -1,5 +1,5 @@ import { globals } from "LuauAST/impl/globals"; export function isReservedIdentifier(id: string) { - return globals.hasOwnProperty(id); + return Object.prototype.hasOwnProperty.call(globals, id); }