Skip to content

Commit

Permalink
fix: remote ie11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Aug 9, 2018
1 parent 25eacf8 commit b56353a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
11 changes: 11 additions & 0 deletions src/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
rules: {
'no-restricted-syntax': [
'error',
{
selector: 'ForOfStatement',
message: 'Not supported by bublé'
}
]
}
}
5 changes: 5 additions & 0 deletions src/devtools/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
rules: {
'no-restricted-syntax': 'off'
}
}
25 changes: 12 additions & 13 deletions src/shared-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,16 @@ function sendValue (key, value) {
})
}

// Proxy traps
const traps = {
get (target, key) {
return vm && vm.$data[key]
},
set (target, key, value) {
sendValue(key, value)
return setValue(key, value)
}
}

const SharedDataProxy = new Proxy({}, traps)
const proxy = {}
Object.keys(internalSharedData).forEach(key => {
Object.defineProperty(proxy, key, {
configurable: false,
get: () => vm && vm.$data[key],
set: (value) => {
sendValue(key, value)
setValue(key, value)
}
})
})

export default SharedDataProxy
export default proxy
4 changes: 2 additions & 2 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,8 @@ export function set (object, path, value, cb = null) {

export function get (object, path) {
const sections = path.split('.')
for (const section of sections) {
object = object[section]
for (let i = 0; i < sections.length; i++) {
object = object[sections[i]]
if (!object) {
return undefined
}
Expand Down

0 comments on commit b56353a

Please sign in to comment.