Skip to content

Commit d041032

Browse files
authored
Merge pull request #642 from vuejs/v4.1.4
v4.1.4
2 parents 4994856 + f04db4e commit d041032

File tree

12 files changed

+6638
-8893
lines changed

12 files changed

+6638
-8893
lines changed

package-lock.json

Lines changed: 0 additions & 8453 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-devtools",
3-
"version": "4.1.3",
3+
"version": "4.1.4",
44
"description": "devtools for Vue.js!",
55
"main": "index.js",
66
"scripts": {
@@ -32,7 +32,7 @@
3232
},
3333
"homepage": "https://github.com/vuejs/vue-devtools#readme",
3434
"devDependencies": {
35-
"buble": "^0.18.0",
35+
"buble": "^0.19.0",
3636
"buble-loader": "^0.4.1",
3737
"chromedriver": "^2.34.0",
3838
"cross-env": "^5.1.3",
@@ -46,12 +46,12 @@
4646
"nightwatch": "^0.9.19",
4747
"nightwatch-helpers": "^1.2.0",
4848
"raw-loader": "^0.5.1",
49-
"selenium-server": "2.52.0",
49+
"selenium-server": "2.53.1",
5050
"semver": "^5.4.1",
5151
"stylus": "^0.54.5",
5252
"stylus-loader": "^3.0.1",
5353
"url-loader": "^0.6.2",
54-
"vue-loader": "^13.6.1",
54+
"vue-loader": "^14.2.1",
5555
"vue-template-compiler": "^2.5.13",
5656
"webpack": "^3.10.0",
5757
"webpack-dev-server": "^2.9.7"

shells/chrome/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Vue.js devtools",
3-
"version": "4.1.3",
3+
"version": "4.1.4",
44
"description": "Chrome and Firefox DevTools extension for debugging Vue.js applications.",
55
"manifest_version": 2,
66
"icons": {

shells/dev/target/NativeTypes.vue

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ function setToString (func, string) {
4444
4545
const aWeirdFunction = setToString(function weird (a, b, c) {}, 'foo')
4646
47+
function sum (a, b) {
48+
return a + b
49+
}
50+
51+
const handler = {
52+
apply: function (target, thisArg, argumentsList) {
53+
console.log(`Calculate sum: ${argumentsList}`)
54+
return argumentsList[0] + argumentsList[1]
55+
}
56+
}
57+
58+
const proxy1 = new Proxy(sum, handler)
59+
4760
export default {
4861
components: {
4962
TestComponent: {
@@ -79,7 +92,12 @@ export default {
7992
j: new Map([[1, 2], [3, 4], [5, new Map([[6, 7]])], [8, new Set([1, 2, 3, 4, new Set([5, 6, 7, 8]), new Map([[1, 2], [3, 4], [5, new Map([[6, 7]])]])])]]),
8093
html: '<b>Bold</b> <i>Italic</i>',
8194
htmlReg: /<b>hey<\/b>/i,
82-
'html <b>key</b>': (h, t, m, l) => {}
95+
'html <b>key</b>': (h, t, m, l) => {},
96+
proxy1,
97+
sym: Symbol('test'),
98+
multiLineParameterFunction: function(a,
99+
b,
100+
c) {}
83101
}
84102
},
85103
computed: {

shells/dev/target/store.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export default new Vuex.Store({
88
count: 0,
99
date: new Date(),
1010
set: new Set(),
11-
map: new Map()
11+
map: new Map(),
12+
sym: Symbol('test')
1213
},
1314
mutations: {
1415
INCREMENT: state => state.count++,

src/backend/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function scan () {
163163
if (typeof instance.__VUE_DEVTOOLS_ROOT_UID__ === 'undefined') {
164164
instance.__VUE_DEVTOOLS_ROOT_UID__ = ++rootUID
165165
}
166-
rootInstances.push(instance)
166+
rootInstances.push(instance.$root)
167167
}
168168

169169
return true

src/devtools/locales/en.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ export default {
4444
tooltip: '[[{{keys.ctrl}}]] + [[F]] Filter components by name'
4545
}
4646
},
47+
ComponentInstance: {
48+
consoleId: {
49+
tooltip: 'Available as <mono>{{id}}</mono> in the console.'
50+
}
51+
},
4752
ComponentInspector: {
4853
openInEditor: {
4954
tooltip: 'Open <mono><<insert_drive_file>>{{file}}</mono> in editor'

src/devtools/views/components/ComponentInstance.vue

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,29 @@
2323
</span>
2424
<span class="angle-bracket">&lt;</span><span class="item-name">{{ displayName }}</span><span class="angle-bracket">&gt;</span>
2525
</span>
26-
<span class="info console" v-if="instance.consoleId === '$vm0'">
27-
== {{ instance.consoleId }}
26+
<span
27+
v-if="instance.consoleId"
28+
class="info console"
29+
v-tooltip="$t('ComponentInstance.consoleId.tooltip', { id: instance.consoleId })"
30+
>
31+
= {{ instance.consoleId }}
2832
</span>
29-
<span class="info router-view" v-if="instance.isRouterView">
33+
<span
34+
v-if="instance.isRouterView"
35+
class="info router-view"
36+
>
3037
router-view{{ instance.matchedRouteSegment ? ': ' + instance.matchedRouteSegment : null }}
3138
</span>
32-
<span class="info fragment" v-if="instance.isFragment">
39+
<span
40+
v-if="instance.isFragment"
41+
class="info fragment"
42+
>
3343
fragment
3444
</span>
35-
<span class="info inactive" v-if="instance.inactive">
45+
<span
46+
v-if="instance.inactive"
47+
class="info inactive"
48+
>
3649
inactive
3750
</span>
3851
<span class="spacer"></span>
@@ -187,7 +200,7 @@ export default {
187200
&.console
188201
color #fff
189202
background-color transparent
190-
top 0px
203+
top 0
191204
&.router-view
192205
background-color #ff8344
193206
&.fragment

src/util.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ function replacer (key) {
125125
return NEGATIVE_INFINITY
126126
} else if (type === 'function') {
127127
return getCustomFunctionDetails(val)
128+
} else if (type === 'symbol') {
129+
return `[native Symbol ${Symbol.prototype.toString.call(val)}]`
128130
} else if (val !== null && type === 'object') {
129131
if (val instanceof Map) {
130132
return encodeCache.cache(val, () => getCustomMapDetails(val))
@@ -245,9 +247,15 @@ export function getCustomComponentDefinitionDetails (def) {
245247
}
246248

247249
export function getCustomFunctionDetails (func) {
248-
const string = Function.prototype.toString.call(func) || ''
249-
const matches = string.match(/\(.*\)/)
250-
const args = matches ? matches[0] : '(?)'
250+
let string = ''
251+
try {
252+
string = Function.prototype.toString.call(func)
253+
} catch (e) {
254+
// Func is probably a Proxy, which can break Function.prototype.toString()
255+
}
256+
const matches = string.match(/\([\s\S]*?\)/)
257+
// Trim any excess whitespace from the argument string
258+
const args = matches ? `(${matches[0].substr(1, matches[0].length - 2).split(',').map(a => a.trim()).join(', ')})` : '(?)'
251259
return {
252260
_custom: {
253261
type: 'function',
@@ -263,6 +271,7 @@ export function parse (data, revive) {
263271
}
264272

265273
const specialTypeRE = /^\[native (\w+) (.*)\]$/
274+
const symbolRE = /^\[native Symbol Symbol\((.*)\)\]$/
266275

267276
function reviver (key, val) {
268277
if (val === UNDEFINED) {
@@ -281,6 +290,9 @@ function reviver (key, val) {
281290
} else if (val._custom.type === 'set') {
282291
return reviveSet(val)
283292
}
293+
} else if (symbolRE.test(val)) {
294+
const [, string] = symbolRE.exec(val)
295+
return Symbol.for(string)
284296
} else if (specialTypeRE.test(val)) {
285297
const [, type, string] = specialTypeRE.exec(val)
286298
return new window[type](string)

test/nightwatch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"selenium" : {
77
"start_process" : true,
8-
"server_path" : "node_modules/selenium-server/lib/runner/selenium-server-standalone-2.52.0.jar",
8+
"server_path" : "node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.1.jar",
99
"host" : "127.0.0.1",
1010
"port" : 4444,
1111
"cli_args" : {

0 commit comments

Comments
 (0)