Parcourir la source

fix rebase errors

Evan You il y a 10 ans
Parent
commit
b4a0d98388
3 fichiers modifiés avec 5 ajouts et 20 suppressions
  1. 1 6
      src/compiler/compile.js
  2. 0 10
      src/directive.js
  3. 4 4
      test/unit/specs/compiler/compile_spec.js

+ 1 - 6
src/compiler/compile.js

@@ -555,14 +555,9 @@ function compileDirectives (attrs, options) {
       if (dirDef) {
         dirs.push({
           name: dirName,
-<<<<<<< HEAD
-          descriptors: dirParser.parse(value),
+          descriptor: dirParser.parse(value),
           def: dirDef,
           literal: isLiteral
-=======
-          descriptor: dirParser.parse(value),
-          def: dirDef
->>>>>>> remove old directive parser
         })
       }
     } else

+ 0 - 10
src/directive.js

@@ -141,16 +141,6 @@ Directive.prototype._bind = function () {
 Directive.prototype._checkDynamicLiteral = function () {
   var expression = this.expression
   if (expression && this.isLiteral) {
-
-    if (process.env.NODE_ENV !== 'production') {
-      if (this.name !== 'el' &&
-          this.name !== 'ref' &&
-          this.name !== 'transition' &&
-          this.name !== 'component') {
-        _.deprecation.LITERAL_DIR(this.name)
-      }
-    }
-
     var tokens = textParser.parse(expression)
     if (tokens) {
       var exp = textParser.tokensToExp(tokens)

+ 4 - 4
test/unit/specs/compiler/compile_spec.js

@@ -88,9 +88,9 @@ if (_.inBrowser) {
       var linker = compile(el, Vue.options)
       linker(vm, el)
       expect(vm._bindDir.calls.count()).toBe(3)
-      expect(vm._bindDir).toHaveBeenCalledWith('class', el, descA, Vue.options.directives.class, undefined, undefined, undefined, undefined, undefined)
-      expect(vm._bindDir).toHaveBeenCalledWith('style', el, descB, Vue.options.directives.style, undefined, undefined, undefined, undefined, undefined)
-      expect(vm._bindDir).toHaveBeenCalledWith('attr', el, descC, Vue.options.directives.attr, undefined, undefined, undefined, 'title', undefined)
+      expect(vm._bindDir).toHaveBeenCalledWith('class', el, descA, internalDirectives.class, undefined, undefined, undefined, undefined, undefined)
+      expect(vm._bindDir).toHaveBeenCalledWith('style', el, descB, internalDirectives.style, undefined, undefined, undefined, undefined, undefined)
+      expect(vm._bindDir).toHaveBeenCalledWith('attr', el, descC, internalDirectives.attr, undefined, undefined, undefined, 'title', undefined)
     })
 
     it('on- syntax', function () {
@@ -99,7 +99,7 @@ if (_.inBrowser) {
       var linker = compile(el, Vue.options)
       linker(vm, el)
       expect(vm._bindDir.calls.count()).toBe(1)
-      expect(vm._bindDir).toHaveBeenCalledWith('on', el, desc, Vue.options.directives.on, undefined, undefined, undefined, 'click', undefined)
+      expect(vm._bindDir).toHaveBeenCalledWith('on', el, desc, internalDirectives.on, undefined, undefined, undefined, 'click', undefined)
     })
 
     it('text interpolation', function () {