Report error on export assignment with es6 and above target

Conflicts:
	src/compiler/checker.ts
	tests/baselines/reference/es6ImportDefaultBinding.errors.txt
	tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport1.errors.txt
	tests/baselines/reference/es6ImportDefaultBindingMergeErrors.errors.txt
	tests/baselines/reference/es6ImportEqualsDeclaration.errors.txt
	tests/cases/compiler/es6ImportNameSpaceImportMergeErrors.ts
	tests/cases/compiler/es6ImportNameSpaceImportNoNamedExports.ts
	tests/cases/compiler/es6ImportNamedImportInExportAssignment.ts
	tests/cases/compiler/es6ImportNamedImportInIndirectExportAssignment.ts
	tests/cases/compiler/es6ImportNamedImportNoNamedExports.ts
This commit is contained in:
Mohamed Hegazy
2015-03-11 21:53:37 -07:00
parent e902d8462e
commit 61a5bfb09d
7 changed files with 38 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
tests/cases/compiler/es6ExportAssignment.ts(3,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/compiler/es6ExportAssignment.ts(3,1): error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.
==== tests/cases/compiler/es6ExportAssignment.ts (2 errors) ====
var a = 10;
export = a;
~~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~~~~~~~~~~~
!!! error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.

View File

@@ -0,0 +1,8 @@
//// [es6ExportAssignment.ts]
var a = 10;
export = a;
//// [es6ExportAssignment.js]
var a = 10;
module.exports = a;

View File

@@ -1,15 +1,18 @@
tests/cases/compiler/client.ts(1,1): error TS1200: Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * from "mod"', 'import {a} from "mod"' or 'import d from "mod"' instead.
tests/cases/compiler/server.ts(3,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
tests/cases/compiler/server.ts(3,1): error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.
==== tests/cases/compiler/client.ts (1 errors) ====
import a = require("server");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1200: Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * from "mod"', 'import {a} from "mod"' or 'import d from "mod"' instead.
==== tests/cases/compiler/server.ts (1 errors) ====
==== tests/cases/compiler/server.ts (2 errors) ====
var a = 10;
export = a;
~~~~~~~~~~~
!!! error TS1148: Cannot compile external modules unless the '--module' flag is provided.
~~~~~~~~~~~
!!! error TS1201: Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead.

View File

@@ -0,0 +1,4 @@
// @target: es6
var a = 10;
export = a;