File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 11import Watcher from '../../watcher'
2- import { del } from '../../util/index'
2+ import { del , toArray } from '../../util/index'
33import { parseText } from '../../parsers/text'
44import { parseDirective } from '../../parsers/directive'
55import { getPath } from '../../parsers/path'
@@ -23,7 +23,9 @@ export default function (Vue) {
2323 if ( asStatement && ! isSimplePath ( exp ) ) {
2424 var self = this
2525 return function statementHandler ( ) {
26+ self . $arguments = toArray ( arguments )
2627 res . get . call ( self , self )
28+ self . $arguments = null
2729 }
2830 } else {
2931 try {
Original file line number Diff line number Diff line change @@ -237,6 +237,24 @@ describe('Instance Events', function () {
237237 expect ( vm . a ) . toBe ( 1 )
238238 } )
239239
240+ it ( 'passing $arguments' , function ( ) {
241+ new Vue ( {
242+ el : document . createElement ( 'div' ) ,
243+ template : '<comp @ready="onReady($arguments[1])"></comp>' ,
244+ methods : {
245+ onReady : spy
246+ } ,
247+ components : {
248+ comp : {
249+ compiled : function ( ) {
250+ this . $emit ( 'ready' , 123 , 1234 )
251+ }
252+ }
253+ }
254+ } )
255+ expect ( spy ) . toHaveBeenCalledWith ( 1234 )
256+ } )
257+
240258 describe ( 'attached/detached' , function ( ) {
241259
242260 it ( 'in DOM' , function ( ) {
You can’t perform that action at this time.
0 commit comments