]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: update snapshots for toDisplayString
authorEvan You <yyx990803@gmail.com>
Mon, 27 Jan 2020 19:42:01 +0000 (14:42 -0500)
committerEvan You <yyx990803@gmail.com>
Mon, 27 Jan 2020 21:00:18 +0000 (16:00 -0500)
packages/compiler-core/__tests__/__snapshots__/codegen.spec.ts.snap
packages/compiler-core/__tests__/__snapshots__/compile.spec.ts.snap
packages/compiler-core/__tests__/__snapshots__/scopeId.spec.ts.snap
packages/compiler-core/__tests__/transforms/__snapshots__/hoistStatic.spec.ts.snap
packages/compiler-core/__tests__/transforms/__snapshots__/transformText.spec.ts.snap
packages/compiler-core/__tests__/transforms/__snapshots__/vSlot.spec.ts.snap
packages/compiler-sfc/__tests__/__snapshots__/compileTemplate.spec.ts.snap

index 785d3be37e2c6b38f0ba92b710625a444c028d54..6b09fa2f7d6189b6db8e2993261ce4d7dfbec356 100644 (file)
@@ -99,7 +99,7 @@ exports[`compiler: codegen compound expression 1`] = `
 "
 return function render() {
   with (this) {
-    return _ctx.foo + _toString(bar)
+    return _ctx.foo + _toDisplayString(bar)
   }
 }"
 `;
@@ -159,7 +159,7 @@ exports[`compiler: codegen interpolation 1`] = `
 "
 return function render() {
   with (this) {
-    return _toString(hello)
+    return _toDisplayString(hello)
   }
 }"
 `;
index 55bb9f92114f3f5fa8dadd071bf39a77cdd5f9bc..a5b0cc9b0fc42f94dfc78fd926f97e41db5f2acc 100644 (file)
@@ -5,19 +5,19 @@ exports[`compiler: integration tests function mode 1`] = `
 
 return function render() {
   with (this) {
-    const { toString: _toString, openBlock: _openBlock, createVNode: _createVNode, createBlock: _createBlock, createCommentVNode: _createCommentVNode, Fragment: _Fragment, renderList: _renderList, createTextVNode: _createTextVNode } = _Vue
+    const { toDisplayString: _toDisplayString, openBlock: _openBlock, createVNode: _createVNode, createBlock: _createBlock, createCommentVNode: _createCommentVNode, Fragment: _Fragment, renderList: _renderList, createTextVNode: _createTextVNode } = _Vue
     
     return (_openBlock(), _createBlock(\\"div\\", {
       id: \\"foo\\",
       class: bar.baz
     }, [
-      _createTextVNode(_toString(world.burn()) + \\" \\", 1 /* TEXT */),
+      _createTextVNode(_toDisplayString(world.burn()) + \\" \\", 1 /* TEXT */),
       (_openBlock(), ok
         ? _createBlock(\\"div\\", { key: 0 }, \\"yes\\")
         : _createBlock(_Fragment, { key: 1 }, [\\"no\\"])),
       (_openBlock(false), _createBlock(_Fragment, null, _renderList(list, (value, index) => {
         return (_openBlock(), _createBlock(\\"div\\", null, [
-          _createVNode(\\"span\\", null, _toString(value + index), 1 /* TEXT */)
+          _createVNode(\\"span\\", null, _toDisplayString(value + index), 1 /* TEXT */)
         ]))
       }), 256 /* UNKEYED_FRAGMENT */))
     ], 2 /* CLASS */))
@@ -26,7 +26,7 @@ return function render() {
 `;
 
 exports[`compiler: integration tests function mode w/ prefixIdentifiers: true 1`] = `
-"const { toString, openBlock, createVNode, createBlock, createCommentVNode, Fragment, renderList, createTextVNode } = Vue
+"const { toDisplayString, openBlock, createVNode, createBlock, createCommentVNode, Fragment, renderList, createTextVNode } = Vue
 
 return function render() {
   const _ctx = this
@@ -34,13 +34,13 @@ return function render() {
     id: \\"foo\\",
     class: _ctx.bar.baz
   }, [
-    createTextVNode(toString(_ctx.world.burn()) + \\" \\", 1 /* TEXT */),
+    createTextVNode(toDisplayString(_ctx.world.burn()) + \\" \\", 1 /* TEXT */),
     (openBlock(), (_ctx.ok)
       ? createBlock(\\"div\\", { key: 0 }, \\"yes\\")
       : createBlock(Fragment, { key: 1 }, [\\"no\\"])),
     (openBlock(false), createBlock(Fragment, null, renderList(_ctx.list, (value, index) => {
       return (openBlock(), createBlock(\\"div\\", null, [
-        createVNode(\\"span\\", null, toString(value + index), 1 /* TEXT */)
+        createVNode(\\"span\\", null, toDisplayString(value + index), 1 /* TEXT */)
       ]))
     }), 256 /* UNKEYED_FRAGMENT */))
   ], 2 /* CLASS */))
@@ -48,7 +48,7 @@ return function render() {
 `;
 
 exports[`compiler: integration tests module mode 1`] = `
-"import { toString, openBlock, createVNode, createBlock, createCommentVNode, Fragment, renderList, createTextVNode } from \\"vue\\"
+"import { toDisplayString, openBlock, createVNode, createBlock, createCommentVNode, Fragment, renderList, createTextVNode } from \\"vue\\"
 
 export function render() {
   const _ctx = this
@@ -56,13 +56,13 @@ export function render() {
     id: \\"foo\\",
     class: _ctx.bar.baz
   }, [
-    createTextVNode(toString(_ctx.world.burn()) + \\" \\", 1 /* TEXT */),
+    createTextVNode(toDisplayString(_ctx.world.burn()) + \\" \\", 1 /* TEXT */),
     (openBlock(), (_ctx.ok)
       ? createBlock(\\"div\\", { key: 0 }, \\"yes\\")
       : createBlock(Fragment, { key: 1 }, [\\"no\\"])),
     (openBlock(false), createBlock(Fragment, null, renderList(_ctx.list, (value, index) => {
       return (openBlock(), createBlock(\\"div\\", null, [
-        createVNode(\\"span\\", null, toString(value + index), 1 /* TEXT */)
+        createVNode(\\"span\\", null, toDisplayString(value + index), 1 /* TEXT */)
       ]))
     }), 256 /* UNKEYED_FRAGMENT */))
   ], 2 /* CLASS */))
index d0fd955caa793a54a3041680fd19bb08fa2693e5..e08bf68525f0042db7e22221674ff07d10841a9c 100644 (file)
@@ -65,7 +65,7 @@ export const render = withId(function render() {
 `;
 
 exports[`scopeId compiler support should wrap named slots 1`] = `
-"import { toString, createTextVNode, createVNode, resolveComponent, createBlock, openBlock, withScopeId } from \\"vue\\"
+"import { toDisplayString, createTextVNode, createVNode, resolveComponent, createBlock, openBlock, withScopeId } from \\"vue\\"
 const withId = withScopeId(\\"test\\")
 
 export const render = withId(function render() {
@@ -74,7 +74,7 @@ export const render = withId(function render() {
   
   return (openBlock(), createBlock(_component_Child, null, {
     foo: withId(({ msg }) => [
-      createTextVNode(toString(msg), 1 /* TEXT */)
+      createTextVNode(toDisplayString(msg), 1 /* TEXT */)
     ]),
     bar: withId(() => [
       createVNode(\\"div\\")
index bce5d8ed7a254a1a2e764cabda579e275b237963..32ceceaa12effd3bf1f55b06b6085c3bfba6fa38 100644 (file)
@@ -121,10 +121,10 @@ const _hoisted_1 = { id: \\"foo\\" }
 
 return function render() {
   with (this) {
-    const { toString: _toString, createVNode: _createVNode, createBlock: _createBlock, openBlock: _openBlock } = _Vue
+    const { toDisplayString: _toDisplayString, createVNode: _createVNode, createBlock: _createBlock, openBlock: _openBlock } = _Vue
     
     return (_openBlock(), _createBlock(\\"div\\", null, [
-      _createVNode(\\"div\\", _hoisted_1, _toString(hello), 1 /* TEXT */)
+      _createVNode(\\"div\\", _hoisted_1, _toDisplayString(hello), 1 /* TEXT */)
     ]))
   }
 }"
@@ -159,10 +159,10 @@ const _hoisted_1 = { class: { foo: true } }
 
 return function render() {
   with (this) {
-    const { toString: _toString, createVNode: _createVNode, createBlock: _createBlock, openBlock: _openBlock } = _Vue
+    const { toDisplayString: _toDisplayString, createVNode: _createVNode, createBlock: _createBlock, openBlock: _openBlock } = _Vue
     
     return (_openBlock(), _createBlock(\\"div\\", null, [
-      _createVNode(\\"span\\", _hoisted_1, _toString(_ctx.bar), 1 /* TEXT */)
+      _createVNode(\\"span\\", _hoisted_1, _toDisplayString(_ctx.bar), 1 /* TEXT */)
     ]))
   }
 }"
@@ -174,14 +174,14 @@ const { createVNode: _createVNode } = Vue
 
 const _hoisted_1 = _createVNode(\\"span\\", null, [
   \\"foo \\",
-  _toString(1),
+  _toDisplayString(1),
   \\" \\",
-  _toString(true)
+  _toDisplayString(true)
 ])
 
 return function render() {
   with (this) {
-    const { toString: _toString, createVNode: _createVNode, createBlock: _createBlock, openBlock: _openBlock } = _Vue
+    const { toDisplayString: _toDisplayString, createVNode: _createVNode, createBlock: _createBlock, openBlock: _openBlock } = _Vue
     
     return (_openBlock(), _createBlock(\\"div\\", null, [
       _hoisted_1
@@ -194,11 +194,11 @@ exports[`compiler: hoistStatic transform prefixIdentifiers hoist nested static t
 "const _Vue = Vue
 const { createVNode: _createVNode } = Vue
 
-const _hoisted_1 = _createVNode(\\"span\\", { foo: 0 }, _toString(1))
+const _hoisted_1 = _createVNode(\\"span\\", { foo: 0 }, _toDisplayString(1))
 
 return function render() {
   with (this) {
-    const { toString: _toString, createVNode: _createVNode, createBlock: _createBlock, openBlock: _openBlock } = _Vue
+    const { toDisplayString: _toDisplayString, createVNode: _createVNode, createBlock: _createBlock, openBlock: _openBlock } = _Vue
     
     return (_openBlock(), _createBlock(\\"div\\", null, [
       _hoisted_1
@@ -228,12 +228,12 @@ exports[`compiler: hoistStatic transform prefixIdentifiers should NOT hoist expr
 
 return function render() {
   with (this) {
-    const { renderList: _renderList, openBlock: _openBlock, createBlock: _createBlock, Fragment: _Fragment, toString: _toString, createVNode: _createVNode } = _Vue
+    const { renderList: _renderList, openBlock: _openBlock, createBlock: _createBlock, Fragment: _Fragment, toDisplayString: _toDisplayString, createVNode: _createVNode } = _Vue
     
     return (_openBlock(), _createBlock(\\"div\\", null, [
       (_openBlock(false), _createBlock(_Fragment, null, _renderList(_ctx.list, (o) => {
         return (_openBlock(), _createBlock(\\"p\\", null, [
-          _createVNode(\\"span\\", null, _toString(o + 'foo'), 1 /* TEXT */)
+          _createVNode(\\"span\\", null, _toDisplayString(o + 'foo'), 1 /* TEXT */)
         ]))
       }), 256 /* UNKEYED_FRAGMENT */))
     ]))
@@ -246,12 +246,12 @@ exports[`compiler: hoistStatic transform prefixIdentifiers should NOT hoist expr
 
 return function render() {
   with (this) {
-    const { toString: _toString, resolveComponent: _resolveComponent, createVNode: _createVNode, createBlock: _createBlock, openBlock: _openBlock } = _Vue
+    const { toDisplayString: _toDisplayString, resolveComponent: _resolveComponent, createVNode: _createVNode, createBlock: _createBlock, openBlock: _openBlock } = _Vue
     
     const _component_Comp = _resolveComponent(\\"Comp\\")
     
     return (_openBlock(), _createBlock(_component_Comp, null, {
-      default: ({ foo }) => [_toString(_ctx.foo)],
+      default: ({ foo }) => [_toDisplayString(_ctx.foo)],
       _compiled: true
     }))
   }
@@ -263,12 +263,12 @@ exports[`compiler: hoistStatic transform prefixIdentifiers should NOT hoist expr
 
 return function render() {
   with (this) {
-    const { renderList: _renderList, openBlock: _openBlock, createBlock: _createBlock, Fragment: _Fragment, toString: _toString, createVNode: _createVNode } = _Vue
+    const { renderList: _renderList, openBlock: _openBlock, createBlock: _createBlock, Fragment: _Fragment, toDisplayString: _toDisplayString, createVNode: _createVNode } = _Vue
     
     return (_openBlock(), _createBlock(\\"div\\", null, [
       (_openBlock(false), _createBlock(_Fragment, null, _renderList(_ctx.list, (o) => {
         return (_openBlock(), _createBlock(\\"p\\", null, [
-          _createVNode(\\"span\\", null, _toString(o), 1 /* TEXT */)
+          _createVNode(\\"span\\", null, _toDisplayString(o), 1 /* TEXT */)
         ]))
       }), 256 /* UNKEYED_FRAGMENT */))
     ]))
index edfe8dc3e09dfd3f3d65eaf3df1361586bd4ec18..1576decfb4f90722e067e1a27c9cafff8765c6a5 100644 (file)
@@ -21,9 +21,9 @@ exports[`compiler: transform text consecutive text 1`] = `
 
 return function render() {
   with (this) {
-    const { toString: _toString } = _Vue
+    const { toDisplayString: _toDisplayString } = _Vue
     
-    return _toString(foo) + \\" bar \\" + _toString(baz)
+    return _toDisplayString(foo) + \\" bar \\" + _toDisplayString(baz)
   }
 }"
 `;
@@ -33,11 +33,11 @@ exports[`compiler: transform text consecutive text between elements 1`] = `
 
 return function render() {
   with (this) {
-    const { createVNode: _createVNode, toString: _toString, createTextVNode: _createTextVNode, createBlock: _createBlock, Fragment: _Fragment, openBlock: _openBlock } = _Vue
+    const { createVNode: _createVNode, toDisplayString: _toDisplayString, createTextVNode: _createTextVNode, createBlock: _createBlock, Fragment: _Fragment, openBlock: _openBlock } = _Vue
     
     return (_openBlock(), _createBlock(_Fragment, null, [
       _createVNode(\\"div\\"),
-      _createTextVNode(_toString(foo) + \\" bar \\" + _toString(baz), 1 /* TEXT */),
+      _createTextVNode(_toDisplayString(foo) + \\" bar \\" + _toDisplayString(baz), 1 /* TEXT */),
       _createVNode(\\"div\\")
     ], 64 /* STABLE_FRAGMENT */))
   }
@@ -49,11 +49,11 @@ exports[`compiler: transform text consecutive text mixed with elements 1`] = `
 
 return function render() {
   with (this) {
-    const { createVNode: _createVNode, toString: _toString, createTextVNode: _createTextVNode, createBlock: _createBlock, Fragment: _Fragment, openBlock: _openBlock } = _Vue
+    const { createVNode: _createVNode, toDisplayString: _toDisplayString, createTextVNode: _createTextVNode, createBlock: _createBlock, Fragment: _Fragment, openBlock: _openBlock } = _Vue
     
     return (_openBlock(), _createBlock(_Fragment, null, [
       _createVNode(\\"div\\"),
-      _createTextVNode(_toString(foo) + \\" bar \\" + _toString(baz), 1 /* TEXT */),
+      _createTextVNode(_toDisplayString(foo) + \\" bar \\" + _toDisplayString(baz), 1 /* TEXT */),
       _createVNode(\\"div\\"),
       _createTextVNode(\\"hello\\"),
       _createVNode(\\"div\\")
@@ -67,9 +67,9 @@ exports[`compiler: transform text no consecutive text 1`] = `
 
 return function render() {
   with (this) {
-    const { toString: _toString } = _Vue
+    const { toDisplayString: _toDisplayString } = _Vue
     
-    return _toString(foo)
+    return _toDisplayString(foo)
   }
 }"
 `;
@@ -91,10 +91,10 @@ return function render() {
 `;
 
 exports[`compiler: transform text with prefixIdentifiers: true 1`] = `
-"const { toString } = Vue
+"const { toDisplayString } = Vue
 
 return function render() {
   const _ctx = this
-  return toString(_ctx.foo) + \\" bar \\" + toString(_ctx.baz + _ctx.qux)
+  return toDisplayString(_ctx.foo) + \\" bar \\" + toDisplayString(_ctx.baz + _ctx.qux)
 }"
 `;
index e7f44eec76a50f81c53241e28cd22c21b71f83da..ef980e09dc1aa5b7c776b1c44bd8fb27ffd8dcaf 100644 (file)
@@ -1,15 +1,15 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
 exports[`compiler: transform component slots dynamically named slots 1`] = `
-"const { toString, resolveComponent, createVNode, createBlock, openBlock } = Vue
+"const { toDisplayString, resolveComponent, createVNode, createBlock, openBlock } = Vue
 
 return function render() {
   const _ctx = this
   const _component_Comp = resolveComponent(\\"Comp\\")
   
   return (openBlock(), createBlock(_component_Comp, null, {
-    [_ctx.one]: ({ foo }) => [toString(foo), toString(_ctx.bar)],
-    [_ctx.two]: ({ bar }) => [toString(_ctx.foo), toString(bar)],
+    [_ctx.one]: ({ foo }) => [toDisplayString(foo), toDisplayString(_ctx.bar)],
+    [_ctx.two]: ({ bar }) => [toDisplayString(_ctx.foo), toDisplayString(bar)],
     _compiled: true
   }, 512 /* DYNAMIC_SLOTS */))
 }"
@@ -32,7 +32,7 @@ return function render() {
 `;
 
 exports[`compiler: transform component slots named slot with v-for w/ prefixIdentifiers: true 1`] = `
-"const { toString, resolveComponent, renderList, createSlots, createVNode, createBlock, openBlock } = Vue
+"const { toDisplayString, resolveComponent, renderList, createSlots, createVNode, createBlock, openBlock } = Vue
 
 return function render() {
   const _ctx = this
@@ -42,7 +42,7 @@ return function render() {
     renderList(_ctx.list, (name) => {
       return {
         name: name,
-        fn: () => [toString(name)]
+        fn: () => [toDisplayString(name)]
       }
     })
   ]), 512 /* DYNAMIC_SLOTS */))
@@ -50,7 +50,7 @@ return function render() {
 `;
 
 exports[`compiler: transform component slots named slot with v-if + prefixIdentifiers: true 1`] = `
-"const { toString, resolveComponent, createSlots, createVNode, createBlock, openBlock } = Vue
+"const { toDisplayString, resolveComponent, createSlots, createVNode, createBlock, openBlock } = Vue
 
 return function render() {
   const _ctx = this
@@ -60,7 +60,7 @@ return function render() {
     (_ctx.ok)
       ? {
           name: \\"one\\",
-          fn: (props) => [toString(props)]
+          fn: (props) => [toDisplayString(props)]
         }
       : undefined
   ]), 512 /* DYNAMIC_SLOTS */))
@@ -118,15 +118,15 @@ return function render() {
 `;
 
 exports[`compiler: transform component slots named slots 1`] = `
-"const { toString, resolveComponent, createVNode, createBlock, openBlock } = Vue
+"const { toDisplayString, resolveComponent, createVNode, createBlock, openBlock } = Vue
 
 return function render() {
   const _ctx = this
   const _component_Comp = resolveComponent(\\"Comp\\")
   
   return (openBlock(), createBlock(_component_Comp, null, {
-    one: ({ foo }) => [toString(foo), toString(_ctx.bar)],
-    two: ({ bar }) => [toString(_ctx.foo), toString(bar)],
+    one: ({ foo }) => [toDisplayString(foo), toDisplayString(_ctx.bar)],
+    two: ({ bar }) => [toDisplayString(_ctx.foo), toDisplayString(bar)],
     _compiled: true
   }))
 }"
@@ -154,7 +154,7 @@ return function render() {
 `;
 
 exports[`compiler: transform component slots nested slots scoping 1`] = `
-"const { toString, resolveComponent, createVNode, createBlock, openBlock } = Vue
+"const { toDisplayString, resolveComponent, createVNode, createBlock, openBlock } = Vue
 
 return function render() {
   const _ctx = this
@@ -164,13 +164,13 @@ return function render() {
   return (openBlock(), createBlock(_component_Comp, null, {
     default: ({ foo }) => [
       createVNode(_component_Inner, null, {
-        default: ({ bar }) => [toString(foo), toString(bar), toString(_ctx.baz)],
+        default: ({ bar }) => [toDisplayString(foo), toDisplayString(bar), toDisplayString(_ctx.baz)],
         _compiled: true
       }, 512 /* DYNAMIC_SLOTS */),
       \\" \\",
-      toString(foo),
-      toString(_ctx.bar),
-      toString(_ctx.baz)
+      toDisplayString(foo),
+      toDisplayString(_ctx.bar),
+      toDisplayString(_ctx.baz)
     ],
     _compiled: true
   }))
@@ -178,14 +178,14 @@ return function render() {
 `;
 
 exports[`compiler: transform component slots on-component default slot 1`] = `
-"const { toString, resolveComponent, createVNode, createBlock, openBlock } = Vue
+"const { toDisplayString, resolveComponent, createVNode, createBlock, openBlock } = Vue
 
 return function render() {
   const _ctx = this
   const _component_Comp = resolveComponent(\\"Comp\\")
   
   return (openBlock(), createBlock(_component_Comp, null, {
-    default: ({ foo }) => [toString(foo), toString(_ctx.bar)],
+    default: ({ foo }) => [toDisplayString(foo), toDisplayString(_ctx.bar)],
     _compiled: true
   }))
 }"
index b202464387b45647b870ea7546de589fc20fb0d9..aba3255df9e9aa5a7dc67145cd70f45a26eb38af 100644 (file)
@@ -2,7 +2,7 @@
 
 exports[`source map 1`] = `
 Object {
-  "mappings": ";;;;UAAA,aACE,YAA8B;IAAzB,YAAmB,oBAAbA,WAAM",
+  "mappings": ";;;;UAAA,aACE,YAA8B;IAAzB,YAAmB,2BAAbA,WAAM",
   "names": Array [
     "render",
   ],