Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
update to use object prototype, not built ins
Browse files Browse the repository at this point in the history
  • Loading branch information
Anemy committed Dec 5, 2023
1 parent 753317e commit 3bb358c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export function getScopeFunction(key: string, withNew: boolean): Function {
}

export function isMethodWhitelisted(member: string, property: string): boolean {
if (ALLOWED_CLASS_EXPRESSIONS.hasOwnProperty(member)) {
if (Object.prototype.hasOwnProperty.call(ALLOWED_CLASS_EXPRESSIONS, member)) {
const allowedMethods = ALLOWED_CLASS_EXPRESSIONS[member].allowedMethods;

if (typeof allowedMethods === 'string') {
Expand All @@ -248,7 +248,7 @@ export function isMethodWhitelisted(member: string, property: string): boolean {
}

export function getClass(member: string) {
if (ALLOWED_CLASS_EXPRESSIONS.hasOwnProperty(member)) {
if (Object.prototype.hasOwnProperty.call(ALLOWED_CLASS_EXPRESSIONS, member)) {
return ALLOWED_CLASS_EXPRESSIONS[member].class;
}
throw new Error(`Attempted to access member '${member}' that doesn't exist`);
Expand Down

0 comments on commit 3bb358c

Please sign in to comment.