TypeScript/tests/cases/compiler/jsFileCompilationBindStrictModeErrors.ts

41 lines
712 B
TypeScript
Raw Normal View History

2015-12-02 21:35:34 +01:00
// @allowJs: true
// @checkJs: true
2015-12-02 21:35:34 +01:00
// @noEmit: true
// @filename: a.js
// @target: es6
"use strict";
var a = {
a: "hello", // error
b: 10,
a: 10 // error
};
var let = 10; // error
delete a; // error
try {
} catch (eval) { // error
}
function arguments() { // error
}
2015-12-02 23:00:34 +01:00
2015-12-02 21:35:34 +01:00
with (a) {
b = 10;
}
// @filename: b.js
// this is not in strict mode but class definitions are always in strict mode
class c {
a(eval) { //error
}
2015-12-02 23:00:34 +01:00
method() {
var let = 10; // error
}
2015-12-02 21:35:34 +01:00
}
// @filename: c.js
export var let = 10; // external modules are automatically in strict mode
var eval = function () {
2015-12-02 23:00:34 +01:00
};
//@filename: d.js
"use strict";
var x = 009; // error