core.js (jshint-2.13.5) | : | core.js (jshint-2.13.6) | ||
---|---|---|---|---|
skipping to change at line 849 | skipping to change at line 849 | |||
"const m = undefined === 0;", | "const m = undefined === 0;", | |||
"let n = undefined === 0;", | "let n = undefined === 0;", | |||
"let [ o = undefined === 0 ] = [];", | "let [ o = undefined === 0 ] = [];", | |||
"[ o = undefined === 0] = [];", | "[ o = undefined === 0] = [];", | |||
"let { p = undefined === 0, x: q = undefined === 0 } = {};", | "let { p = undefined === 0, x: q = undefined === 0 } = {};", | |||
"({ p = undefined === 0, x: q = undefined === 0 } = {});" | "({ p = undefined === 0, x: q = undefined === 0 } = {});" | |||
]; | ]; | |||
TestRun(test) | TestRun(test) | |||
.addError(1, 5, "It's not necessary to initialize 'x' to 'undefined'.") | .addError(1, 5, "It's not necessary to initialize 'x' to 'undefined'.") | |||
.addError(2, 7, "It's not necessary to initialize 'y' to 'undefined'.") | ||||
.addError(3, 5, "It's not necessary to initialize 'z' to 'undefined'.") | .addError(3, 5, "It's not necessary to initialize 'z' to 'undefined'.") | |||
.addError(4, 9, "It's not necessary to initialize 'a' to 'undefined'.") | .addError(4, 9, "It's not necessary to initialize 'a' to 'undefined'.") | |||
.addError(6, 9, "It's not necessary to initialize 'c' to 'undefined'.") | ||||
.addError(7, 7, "It's not necessary to initialize 'd' to 'undefined'.") | .addError(7, 7, "It's not necessary to initialize 'd' to 'undefined'.") | |||
.addError(9, 9, "It's not necessary to initialize 'f' to 'undefined'.") | .addError(9, 9, "It's not necessary to initialize 'f' to 'undefined'.") | |||
.addError(10, 11, "It's not necessary to initialize 'g' to 'undefined'.") | ||||
.addError(11, 9, "It's not necessary to initialize 'h' to 'undefined'.") | .addError(11, 9, "It's not necessary to initialize 'h' to 'undefined'.") | |||
.test(src, {esnext: true}); | .test(src, {esnext: true}); | |||
TestRun(test) | ||||
.addError(1, 8, "It's not necessary to initialize 'x' to 'undefined'.") | ||||
.addError(2, 8, "It's not necessary to initialize 'y' to 'undefined'.") | ||||
.test([ | ||||
"const {x = undefined} = {};", | ||||
"const [y = undefined] = [];", | ||||
], {esversion: 6}); | ||||
test.done(); | test.done(); | |||
}; | }; | |||
exports.testES6Modules = function (test) { | exports.testES6Modules = function (test) { | |||
var src = fs.readFileSync(__dirname + "/fixtures/es6-import-export.js", "utf8" ); | var src = fs.readFileSync(__dirname + "/fixtures/es6-import-export.js", "utf8" ); | |||
var importConstErrors = [ | var importConstErrors = [ | |||
[51, 1, "Attempting to override '$' which is a constant."], | [51, 1, "Attempting to override '$' which is a constant."], | |||
[52, 1, "Attempting to override 'emGet' which is a constant."], | [52, 1, "Attempting to override 'emGet' which is a constant."], | |||
[53, 1, "Attempting to override 'one' which is a constant."], | [53, 1, "Attempting to override 'one' which is a constant."], | |||
skipping to change at line 1166 | skipping to change at line 1171 | |||
"export var v1u, v2u;", | "export var v1u, v2u;", | |||
"export let l1u, l2u;", | "export let l1u, l2u;", | |||
"export const c1u, c2u;", | "export const c1u, c2u;", | |||
"export function* gen() { yield 1; }", | "export function* gen() { yield 1; }", | |||
"export var { varX } = 0;", | "export var { varX } = 0;", | |||
"export let { letX } = 0;", | "export let { letX } = 0;", | |||
"export const { constX } = 0;" | "export const { constX } = 0;" | |||
]; | ]; | |||
TestRun(test) | TestRun(test) | |||
.addError(19, 14, "const 'c1u' is initialized to 'undefined'.") | .addError(19, 14, "Missing initializer for constant 'c1u'.") | |||
.addError(19, 19, "const 'c2u' is initialized to 'undefined'.") | .addError(19, 19, "Missing initializer for constant 'c2u'.") | |||
.test(src1, { | .test(src1, { | |||
esnext: true, | esnext: true, | |||
unused: true | unused: true | |||
}); | }); | |||
test.done(); | test.done(); | |||
}; | }; | |||
exports.testConstRedeclaration = function (test) { | exports.testConstRedeclaration = function (test) { | |||
skipping to change at line 2558 | skipping to change at line 2563 | |||
.addError(1, 12, "Unrecoverable syntax error. (100% scanned).") | .addError(1, 12, "Unrecoverable syntax error. (100% scanned).") | |||
.test([ | .test([ | |||
"for (const;)" | "for (const;)" | |||
], { esversion: 6 }); | ], { esversion: 6 }); | |||
test.done(); | test.done(); | |||
}; | }; | |||
exports.constWithoutInit = function(test) { | exports.constWithoutInit = function(test) { | |||
TestRun(test, "single binding") | TestRun(test, "single binding") | |||
.addError(1, 6, "const 'x' is initialized to 'undefined'.") | .addError(1, 6, "Missing initializer for constant 'x'.") | |||
.test([ | .test([ | |||
"for (const x; ;) {", | "for (const x; ;) {", | |||
" void x;", | " void x;", | |||
"}" | "}" | |||
], { esversion: 6 }); | ], { esversion: 6 }); | |||
TestRun(test, "multiple bindings") | TestRun(test, "multiple bindings") | |||
.addError(1, 6, "const 'y' is initialized to 'undefined'.") | .addError(1, 6, "Missing initializer for constant 'y'.") | |||
.test([ | .test([ | |||
"for (const y, z; ;) {", | "for (const y, z; ;) {", | |||
" void (y, z);", | " void (y, z);", | |||
"}" | "}" | |||
], { esversion: 6 }); | ], { esversion: 6 }); | |||
test.done(); | test.done(); | |||
}; | }; | |||
// regression test for gh-3595 | // regression test for gh-3595 | |||
End of changes. 7 change blocks. | ||||
7 lines changed or deleted | 12 lines changed or added |