From b56353a31d5e9a00c64feea526fe29fd56f0df9f Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Thu, 9 Aug 2018 15:41:01 +0200 Subject: [PATCH] fix: remote ie11 support --- src/.eslintrc.js | 11 +++++++++++ src/devtools/.eslintrc.js | 5 +++++ src/shared-data.js | 25 ++++++++++++------------- src/util.js | 4 ++-- 4 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 src/.eslintrc.js create mode 100644 src/devtools/.eslintrc.js diff --git a/src/.eslintrc.js b/src/.eslintrc.js new file mode 100644 index 000000000..a8ef3766f --- /dev/null +++ b/src/.eslintrc.js @@ -0,0 +1,11 @@ +module.exports = { + rules: { + 'no-restricted-syntax': [ + 'error', + { + selector: 'ForOfStatement', + message: 'Not supported by bublé' + } + ] + } +} \ No newline at end of file diff --git a/src/devtools/.eslintrc.js b/src/devtools/.eslintrc.js new file mode 100644 index 000000000..ea11501a1 --- /dev/null +++ b/src/devtools/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + rules: { + 'no-restricted-syntax': 'off' + } +} \ No newline at end of file diff --git a/src/shared-data.js b/src/shared-data.js index b0c4c0662..1aeb2f74c 100644 --- a/src/shared-data.js +++ b/src/shared-data.js @@ -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 diff --git a/src/util.js b/src/util.js index 3c3266c3a..23829d57e 100644 --- a/src/util.js +++ b/src/util.js @@ -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 }