Skip to content

Commit a8536eb

Browse files
committed
refactor: remove unused logic
1 parent f28c565 commit a8536eb

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

lib/main.js

+5-12
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ let nativeProps = Object.getOwnPropertyNames(window)
77

88
const MiniJS = (() => {
99
window.proxyWindow = null
10-
const isProxy = Symbol('isProxy')
1110

1211
let _debug = false
1312
let _ignoredVariables = []
@@ -30,28 +29,22 @@ const MiniJS = (() => {
3029

3130
const watchHandler = {
3231
set: function (target, property, value) {
33-
let proxyValue = value
34-
const variable = target.__parent__
35-
? `${target.__parent__}.${property}`
36-
: property
37-
3832
// Set variable to new value
39-
target[property] = proxyValue
33+
target[property] = value
4034

4135
// Store to localstorage
4236
if (property[0] === '$') {
43-
localStorage.setItem(property, JSON.stringify(proxyValue))
37+
localStorage.setItem(property, JSON.stringify(value))
4438
}
4539

46-
if (_variables.includes(variable)) {
47-
updateStates(variable)
48-
_addMethodsToVariables([variable])
40+
if (_variables.includes(property)) {
41+
updateStates(property)
42+
_addMethodsToVariables([property])
4943
}
5044

5145
return true
5246
},
5347
get: function (target, property) {
54-
if (property === isProxy) return true
5548
return target[property]
5649
},
5750
}

0 commit comments

Comments
 (0)