Skip to content

Commit

Permalink
fix problematic use of 'deprecated' in warnings (vuejs#4043)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvfritz authored and yyx990803 committed Nov 1, 2016
1 parent 2ac581b commit 8491857
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/compiler/parser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ function processAttrs (el) {
if (expression) {
warn(
`${name}="${value}": ` +
'Interpolation inside attributes has been deprecated. ' +
'Interpolation inside attributes has been removed. ' +
'Use v-bind or the colon shorthand instead. For example, ' +
'instead of <div id="{{ val }}">, use <div :id="val">.'
)
Expand Down
5 changes: 3 additions & 2 deletions src/platforms/web/compiler/modules/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ function transformNode (el: ASTElement, options: CompilerOptions) {
if (expression) {
warn(
`class="${staticClass}": ` +
'Interpolation inside attributes has been deprecated. ' +
'Use v-bind or the colon shorthand instead.'
'Interpolation inside attributes has been removed. ' +
'Use v-bind or the colon shorthand instead. For example, ' +
'instead of <div class="{{ val }}">, use <div :class="val">.'
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/modules/compiler/parser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ describe('parser', () => {
expect(ast2.classBinding).toBe('class1')
// interpolation warning
parse('<p class="{{error}}">hello world</p>', baseOptions)
expect('Interpolation inside attributes has been deprecated').toHaveBeenWarned()
expect('Interpolation inside attributes has been removed').toHaveBeenWarned()
})

it('style binding', () => {
Expand Down Expand Up @@ -318,7 +318,7 @@ describe('parser', () => {
expect(ast1.attrs[2].value).toBe('"hello world"')
// interpolation warning
parse('<input type="text" name="field1" value="{{msg}}">', baseOptions)
expect('Interpolation inside attributes has been deprecated').toHaveBeenWarned()
expect('Interpolation inside attributes has been removed').toHaveBeenWarned()
})

if (!isIE) {
Expand Down

0 comments on commit 8491857

Please sign in to comment.