From 6be3bf4a69b4f59fd5507dfdc7ab5f8ba5d00c67 Mon Sep 17 00:00:00 2001 From: vue-bot Date: Mon, 1 Apr 2019 21:21:20 -0400 Subject: [PATCH 001/239] chore: update sponsors [ci skip] (#9804) --- BACKERS.md | 5 +++++ README.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/BACKERS.md b/BACKERS.md index 9f0d90ede2f..48cef1a74ac 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -214,6 +214,11 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu + + + + + diff --git a/README.md b/README.md index dda1c36afe3..c9b1492ec1d 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,11 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu + + + + + From 8637009b5bbbfa5cee6aa3d9b9dc24922f3dfd50 Mon Sep 17 00:00:00 2001 From: vue-bot Date: Fri, 5 Apr 2019 10:17:49 -0400 Subject: [PATCH 002/239] chore: update backers [ci skip] (#9827) --- BACKERS.md | 95 +++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/BACKERS.md b/BACKERS.md index 48cef1a74ac..c2c184ee478 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -352,114 +352,113 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu - Shawn Wildermuth - Samuel Smith - donny -- Sean Washington - Simon East +- Keisuke Kita - kazupon +- Sean Washington - Lars Andreas Ness +- Benjamin Listwon - Kirk Lewis - Stephen Michael Hartley -- Keisuke Kita -- Wen-Tien Chang -- Benjamin Listwon - Victor Tolbert +- Wen-Tien Chang - Karol - Phan An -- Barbara Liau -- Miljan Aleksic - James J. Ye +- Barbara Liau - Luiz -- Jarek Tkaczyk - Matsumoto Takamasa -- Duncan Kenzie -- Mike Margerum +- Jarek Tkaczyk - Niannian Modisette -- Bernhard E. Reiter - Matt Jones +- Duncan Kenzie - Guy Gavergun +- Shinya Katayama +- Mike Margerum +- Bernhard E. Reiter +- Chengzhi Yin - Zoran Knezevic - Jon Hobbs-Smith - Pierre Vanhulst -- Shinya Katayama -- Asaf Yishai -- Anthony Estebe - Akiho Nagao - Haim Yulzari +- Asaf Yishai +- Anthony Estebe +- Jeremy Tan - Jim Raden - IMGNRY -- Jeremy Tan -- Tyler -- Yong Jun Thong - Tai Shi Ling -- Jamie McElwain -- Matias Verdier +- Yong Jun Thong +- Tyler - Vivekanandhan Natarajan -- Daniel Waghorn -- Mickaël Andrieu -- Chih-Hsuan Fan +- Matias Verdier - Rafael Belvederese +- Chih-Hsuan Fan - Guilherme S L de Souza -- Joe Gregory -- Cliff Hess +- Daniel Waghorn - Rob Yedlin +- Mickaël Andrieu +- Jamie McElwain - Jordan Oroshiba -- RADD Creative -- Marcos Moura +- Cliff Hess +- Joe Gregory - Richard Simpson +- Marcos Moura - Jessie Hernandez -- Aparajita Fishman - Ivan Sieder - Eric +- Aparajita Fishman - Romain Lienard +- Bohdan Kokotko - Christo Crampton - David Ang -- Bohdan Kokotko - Donald Fischer +- Alexander Weiher +- Oskar Lindgren +- Jere Sjöroos - Wakana Seki - David Kaplan +- Ben Hong - Domenico Gaudioso - Jaeyoung Lee -- Ben Hong -- Alexander Weiher -- Oskar Lindgren -- Jere Sjöroos - Andy -- John Cleveland -- Daniel Mattingley - Joe Cochran -- Elon Hung -- Teon Ooi -- Chris Calo -- Colt Borg - Matt Sencenbaugh +- Juan Bermudez - Hannes Kochniß +- Colt Borg - Alberto T. Payero Mota -- Juan Bermudez +- Daniel Mattingley +- Teon Ooi +- Chris Calo +- Elon Hung +- Soichiro Isshiki - Milan Zivkovic -- Garion Herman - Christopher Bemister - Ed Linklater +- Garion Herman - Marko Boskovic -- Soichiro Isshiki +- Rob - Andrew Willis - Yusuke Kawabata - Princeyesuraj Edward - shimbaco -- Nick Dandakis -- Carlos Adrián -- Peter Matkovsky -- 极 蔡 - 龙腾道 -- Kenneth Crawford -- Fedor Indutny +- 极 蔡 +- Peter Matkovsky +- Nick Dandakis - Fabien GuySake Ungerer -- Max Fletcher +- Fedor Indutny - Masato Miura - Nathan Mallison +- Shapovalov Pavel - David McGuigan +- Max Fletcher - Bill Condo - Kevin Batdorf +- Ivan Buncic - Pierre Lebrun -- Juli A Schlack +- Sheree Peña

Backers via OpenCollective

From 94c0918f8d4f16d4d0e77771529f05427b1c2a7b Mon Sep 17 00:00:00 2001 From: vue-bot Date: Fri, 5 Apr 2019 10:18:06 -0400 Subject: [PATCH 003/239] chore: update sponsors [ci skip] (#9828) --- BACKERS.md | 24 ++---------------------- README.md | 19 ++----------------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/BACKERS.md b/BACKERS.md index c2c184ee478..02c6c8f2b39 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -167,43 +167,28 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu - - - - - - - - - - - - - - - - - + + @@ -251,11 +236,6 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu - - - - - diff --git a/README.md b/README.md index c9b1492ec1d..67847827023 100644 --- a/README.md +++ b/README.md @@ -172,43 +172,28 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu - - - - - - - - - - - - - - - - - + + From a8184917a26215629d6194c079c953dff4caacf5 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 5 Apr 2019 22:18:50 +0200 Subject: [PATCH 004/239] docs(contributing): replace npm install with yarn Related to #9831 --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 88f23b3b6ee..50fa9ba782f 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -35,12 +35,12 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before ## Development Setup -You will need [Node.js](http://nodejs.org) **version 6+** and [Java Runtime Environment](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (for running Selenium server during e2e tests). +You will need [Node.js](http://nodejs.org) **version 8+** and [Java Runtime Environment](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (for running Selenium server during e2e tests). After cloning the repo, run: ``` bash -$ npm install # or yarn +$ yarn # it install the dependencies of the project ``` ### Committing Changes From 6a8473411ab67e4b4b00773c5c15b0fad7339b76 Mon Sep 17 00:00:00 2001 From: vue-bot Date: Fri, 5 Apr 2019 22:19:11 -0400 Subject: [PATCH 005/239] chore: update sponsors [ci skip] (#9834) --- BACKERS.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BACKERS.md b/BACKERS.md index 02c6c8f2b39..5b9c38cd829 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -200,7 +200,7 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu - + diff --git a/README.md b/README.md index 67847827023..0ee461f0364 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,7 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu - + From af15d16d62d5ebea28322b703806624dd1ffd039 Mon Sep 17 00:00:00 2001 From: vue-bot Date: Mon, 8 Apr 2019 09:15:00 -0400 Subject: [PATCH 006/239] chore: update sponsors [ci skip] (#9845) --- BACKERS.md | 13 +++++++++---- README.md | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/BACKERS.md b/BACKERS.md index 5b9c38cd829..46e3d4ce14f 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -145,18 +145,23 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu + + + + + + + - - @@ -182,13 +187,13 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu + + - - diff --git a/README.md b/README.md index 0ee461f0364..af7b20c531f 100644 --- a/README.md +++ b/README.md @@ -150,18 +150,23 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu + + + + + + + - - @@ -187,13 +192,13 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu + + - - From 546e7d14adddad643f0065ba91c95d69cbbb020e Mon Sep 17 00:00:00 2001 From: Billy Zou Date: Mon, 8 Apr 2019 14:06:47 -0400 Subject: [PATCH 007/239] docs(contributing): add yarn requirement to guide (#9848) --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 50fa9ba782f..46c49bfbe81 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -35,12 +35,12 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before ## Development Setup -You will need [Node.js](http://nodejs.org) **version 8+** and [Java Runtime Environment](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (for running Selenium server during e2e tests). +You will need [Node.js](http://nodejs.org) **version 8+**, [Java Runtime Environment](http://www.oracle.com/technetwork/java/javase/downloads/index.html) (for running Selenium server during e2e tests) and [yarn](https://yarnpkg.com/en/docs/install). After cloning the repo, run: ``` bash -$ yarn # it install the dependencies of the project +$ yarn # install the dependencies of the project ``` ### Committing Changes From fb4d2c1c632795d1db0e81ad8289cd1718b19e61 Mon Sep 17 00:00:00 2001 From: vue-bot Date: Tue, 9 Apr 2019 22:51:23 -0400 Subject: [PATCH 008/239] chore: update sponsors [ci skip] (#9846) --- BACKERS.md | 5 +++++ README.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/BACKERS.md b/BACKERS.md index 46e3d4ce14f..ab4f08c88ef 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -209,6 +209,11 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu + + + + + diff --git a/README.md b/README.md index af7b20c531f..9438c8ebb20 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,11 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu + + + + + From 15704ce6ef274f30b05b9fc89337a18bbe48ff57 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 10 Apr 2019 11:01:01 +0800 Subject: [PATCH 009/239] chore: use png for sponsor logo --- BACKERS.md | 4 ++-- README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/BACKERS.md b/BACKERS.md index ab4f08c88ef..3f97b61cd2b 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -21,7 +21,7 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu

- +

Platinum via Patreon

@@ -201,7 +201,7 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu - + diff --git a/README.md b/README.md index 9438c8ebb20..ae5d20e5832 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu

- +

Platinum Sponsors

@@ -206,7 +206,7 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu - + From 91b8cda0b28d6774d7319d646c999e04d948a8cd Mon Sep 17 00:00:00 2001 From: Billy Zou Date: Wed, 10 Apr 2019 11:45:47 -0400 Subject: [PATCH 010/239] docs(contributing): fix a grammar error (#9858) --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 46c49bfbe81..3a2082ef646 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -59,7 +59,7 @@ $ npm run dev:test # build all dist files, including npm packages $ npm run build -# run the full test suite, include linting/type checking +# run the full test suite, including linting/type checking $ npm test ``` From f478ab80106b4993398761608aee71b9724e2227 Mon Sep 17 00:00:00 2001 From: vue-bot Date: Wed, 10 Apr 2019 21:00:56 -0400 Subject: [PATCH 011/239] chore: update sponsors [ci skip] (#9860) --- BACKERS.md | 7 ++++++- README.md | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/BACKERS.md b/BACKERS.md index 3f97b61cd2b..414e197862b 100644 --- a/BACKERS.md +++ b/BACKERS.md @@ -21,7 +21,7 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu

- +

Platinum via Patreon

@@ -214,6 +214,11 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu + + + + + diff --git a/README.md b/README.md index ae5d20e5832..da124764d78 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu

- +

Platinum Sponsors

@@ -219,6 +219,11 @@ Funds donated via Patreon go directly to support Evan You's full-time work on Vu + + + + + From 29e745f99f43d0629df547da80b016996ae70872 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Mon, 22 Apr 2019 18:44:01 -0700 Subject: [PATCH 012/239] chore: improve license clarity of simplehtmlparser.js (#9907) --- src/compiler/parser/html-parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/parser/html-parser.js b/src/compiler/parser/html-parser.js index f93c098fa5a..e75ed76539d 100644 --- a/src/compiler/parser/html-parser.js +++ b/src/compiler/parser/html-parser.js @@ -5,7 +5,7 @@ /*! * HTML Parser By John Resig (ejohn.org) * Modified by Juriy "kangax" Zaytsev - * Original code by Erik Arvidsson, Mozilla Public License + * Original code by Erik Arvidsson (MPL-1.1 OR Apache-2.0 OR GPL-2.0-or-later) * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js */ From a9a303009a4267b7f12b956741b4e34dfdc6566f Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 25 Apr 2019 10:00:51 +0800 Subject: [PATCH 013/239] chore: fix SimpleSet export --- src/core/util/env.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/util/env.js b/src/core/util/env.js index eff1d21dc75..820bacdb405 100644 --- a/src/core/util/env.js +++ b/src/core/util/env.js @@ -87,11 +87,10 @@ if (typeof Set !== 'undefined' && isNative(Set)) { } } -interface SimpleSet { +export interface SimpleSet { has(key: string | number): boolean; add(key: string | number): mixed; clear(): void; } export { _Set } -export type { SimpleSet } From ea113d261835d14b7fb7a14896972efc3c8a75b9 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 25 Apr 2019 10:13:32 +0800 Subject: [PATCH 014/239] test: separate failing test for TS 3.4 --- types/test/options-test.ts | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/types/test/options-test.ts b/types/test/options-test.ts index b8bdc098312..28060b7c817 100644 --- a/types/test/options-test.ts +++ b/types/test/options-test.ts @@ -76,10 +76,6 @@ Vue.component('union-prop', { complexUnion: { type: [User, Number] as PropType }, kittyUser: Object as PropType, callback: Function as PropType, - mixed: [RegExp, Array], - object: [Cat, User], - primitive: [String, Number], - regex: RegExp, union: [User, Number] as PropType }, data() { @@ -87,10 +83,6 @@ Vue.component('union-prop', { this.complexUnion; this.kittyUser; this.callback(true); - this.mixed; - this.object; - this.primitive; - this.regex.compile; this.union; return { fixedSize: this.union, @@ -98,6 +90,22 @@ Vue.component('union-prop', { } }); +// stopped working since TS 3.4 +// Vue.component('union-prop-with-no-casting', { +// props: { +// mixed: [RegExp, Array], +// object: [Cat, User], +// primitive: [String, Number], +// regex: RegExp +// }, +// data() { +// this.mixed; +// this.object; +// this.primitive; +// this.regex.compile; +// } +// }) + Vue.component('prop-with-primitive-default', { props: { id: { From 43b98fe25151b0b6bacd36f3ee27c5d61add5fdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=90=E8=BF=9F?= Date: Thu, 25 Apr 2019 10:34:55 +0800 Subject: [PATCH 015/239] refactor: remove useless parameter to the function removeVnodes (#9914) close #9910 --- packages/weex-vue-framework/factory.js | 8 ++++---- src/core/vdom/patch.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/weex-vue-framework/factory.js b/packages/weex-vue-framework/factory.js index 8bcfb675ba9..fb30d12bbbd 100644 --- a/packages/weex-vue-framework/factory.js +++ b/packages/weex-vue-framework/factory.js @@ -5797,7 +5797,7 @@ function createPatchFunction (backend) { } } - function removeVnodes (parentElm, vnodes, startIdx, endIdx) { + function removeVnodes (vnodes, startIdx, endIdx) { for (; startIdx <= endIdx; ++startIdx) { var ch = vnodes[startIdx]; if (isDef(ch)) { @@ -5908,7 +5908,7 @@ function createPatchFunction (backend) { refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); } else if (newStartIdx > newEndIdx) { - removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx); + removeVnodes(oldCh, oldStartIdx, oldEndIdx); } } @@ -5985,7 +5985,7 @@ function createPatchFunction (backend) { if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); } else if (isDef(oldCh)) { - removeVnodes(elm, oldCh, 0, oldCh.length - 1); + removeVnodes(oldCh, 0, oldCh.length - 1); } else if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } @@ -6216,7 +6216,7 @@ function createPatchFunction (backend) { // destroy old node if (isDef(parentElm$1)) { - removeVnodes(parentElm$1, [oldVnode], 0, 0); + removeVnodes([oldVnode], 0, 0); } else if (isDef(oldVnode.tag)) { invokeDestroyHook(oldVnode); } diff --git a/src/core/vdom/patch.js b/src/core/vdom/patch.js index 9746bb794f8..2052df913b3 100644 --- a/src/core/vdom/patch.js +++ b/src/core/vdom/patch.js @@ -358,7 +358,7 @@ export function createPatchFunction (backend) { } } - function removeVnodes (parentElm, vnodes, startIdx, endIdx) { + function removeVnodes (vnodes, startIdx, endIdx) { for (; startIdx <= endIdx; ++startIdx) { const ch = vnodes[startIdx] if (isDef(ch)) { @@ -469,7 +469,7 @@ export function createPatchFunction (backend) { refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue) } else if (newStartIdx > newEndIdx) { - removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx) + removeVnodes(oldCh, oldStartIdx, oldEndIdx) } } @@ -561,7 +561,7 @@ export function createPatchFunction (backend) { if (isDef(oldVnode.text)) nodeOps.setTextContent(elm, '') addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue) } else if (isDef(oldCh)) { - removeVnodes(elm, oldCh, 0, oldCh.length - 1) + removeVnodes(oldCh, 0, oldCh.length - 1) } else if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, '') } @@ -790,7 +790,7 @@ export function createPatchFunction (backend) { // destroy old node if (isDef(parentElm)) { - removeVnodes(parentElm, [oldVnode], 0, 0) + removeVnodes([oldVnode], 0, 0) } else if (isDef(oldVnode.tag)) { invokeDestroyHook(oldVnode) } From bd6cea0973247e2a8e1d4a2250614c0bf44f0b26 Mon Sep 17 00:00:00 2001 From: zrh122 <46116414+zrh122@users.noreply.github.com> Date: Thu, 25 Apr 2019 10:35:16 +0800 Subject: [PATCH 016/239] test: fix running e2e test on windows (#9909) --- test/e2e/nightwatch.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e/nightwatch.config.js b/test/e2e/nightwatch.config.js index 2004f92b45b..8ec592494fe 100644 --- a/test/e2e/nightwatch.config.js +++ b/test/e2e/nightwatch.config.js @@ -50,7 +50,8 @@ module.exports = { 'desiredCapabilities': { 'browserName': 'phantomjs', 'javascriptEnabled': true, - 'acceptSslCerts': true + 'acceptSslCerts': true, + 'phantomjs.binary.path': require('phantomjs-prebuilt').path } } } From 861aea16615a9736eab6af6d05fa5500ae4d6c37 Mon Sep 17 00:00:00 2001 From: Natalia Tepluhina Date: Thu, 25 Apr 2019 05:39:19 +0300 Subject: [PATCH 017/239] polish: add warning when .native modifier is used on native HTML elements (#9884) --- src/core/vdom/create-element.js | 6 ++++++ test/unit/features/directives/on.spec.js | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/core/vdom/create-element.js b/src/core/vdom/create-element.js index 46027084b51..ba36e15b12d 100644 --- a/src/core/vdom/create-element.js +++ b/src/core/vdom/create-element.js @@ -98,6 +98,12 @@ export function _createElement ( ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag) if (config.isReservedTag(tag)) { // platform built-in elements + if (process.env.NODE_ENV !== 'production' && isDef(data) && isDef(data.nativeOn)) { + warn( + `The .native modifier for v-on is only valid on components but it was used on <${tag}>.`, + context + ) + } vnode = new VNode( config.parsePlatformTagName(tag), data, children, undefined, undefined, context diff --git a/test/unit/features/directives/on.spec.js b/test/unit/features/directives/on.spec.js index a97ddaa8947..b7801a82f22 100644 --- a/test/unit/features/directives/on.spec.js +++ b/test/unit/features/directives/on.spec.js @@ -460,6 +460,20 @@ describe('Directive v-on', () => { expect(spy).toHaveBeenCalled() }) + it('should throw a warning if native modifier is used on native HTML element', () => { + vm = new Vue({ + el, + template: ` + + `, + methods: { foo: spy }, + }) + + triggerEvent(vm.$el, 'click') + expect(`The .native modifier for v-on is only valid on components but it was used on