Skip to content

Commit 0533010

Browse files
Merge pull request cerebral#16 from cerebral/proxyStateTreeObjectMethods
fix(proxy-state-tree): fix issue with accessing Object.prototype methods
2 parents ce04326 + 10d304b commit 0533010

File tree

1 file changed

+2
-1
lines changed
  • packages/node_modules/proxy-state-tree/src

1 file changed

+2
-1
lines changed

packages/node_modules/proxy-state-tree/src/proxify.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ function createObjectProxy(tree, value, path) {
9898
if (prop === PATH) return path
9999
if (prop === VALUE) return value
100100

101-
if (typeof prop === 'symbol') return target[prop]
101+
if (typeof prop === 'symbol' || prop in Object.prototype)
102+
return target[prop]
102103

103104
const targetValue = target[prop]
104105
const nestedPath = concat(path, prop)

0 commit comments

Comments
 (0)