Commit graph

6384 commits

Author SHA1 Message Date
Arthur Ozga
868138834b added tests 2015-06-18 16:07:10 -07:00
Arthur Ozga
d596bb750f declarations of abstract methods must be consecutive 2015-06-18 16:06:50 -07:00
Arthur Ozga
326036dbe5 write to declaration file 2015-06-18 15:04:05 -07:00
Arthur Ozga
10c8b6a089 removed comment 2015-06-18 14:44:01 -07:00
Arthur Ozga
4c1002e96b removed premature parser check 2015-06-18 14:39:16 -07:00
Arthur Ozga
6dc430d892 constructor cannot have modifier 'abstract' 2015-06-18 14:18:10 -07:00
Arthur Ozga
5ca3955473 check for inheriting abstract member functions 2015-06-18 12:19:07 -07:00
Arthur Ozga
a07f86240d forbid calling abstract member foo() via super.foo() 2015-06-17 15:01:34 -07:00
Arthur Ozga
388e2fd926 merge with extendsExpressions 2015-06-16 13:33:03 -07:00
Anders Hejlsberg
f6bcf7074c Accepting new baselines after merge 2015-06-16 12:07:49 -07:00
Anders Hejlsberg
2c57776f91 Merge branch 'master' into extendsExpressions
Conflicts:
	src/compiler/checker.ts
	tests/baselines/reference/strictModeReservedWordInClassDeclaration.errors.txt
2015-06-16 12:04:04 -07:00
Anders Hejlsberg
38e3d9f718 Adding another comment 2015-06-16 11:53:00 -07:00
Anders Hejlsberg
de8eb229c8 Adding comments and doing a bit of renaming 2015-06-16 11:49:15 -07:00
Arthur Ozga
864a28a586 forbid abstract methods from having an implementation 2015-06-16 10:02:21 -07:00
Anders Hejlsberg
d09d61f757 Accepting new baselines 2015-06-16 06:55:52 -07:00
Anders Hejlsberg
e305de1403 Workaround to match previous type writer output 2015-06-16 06:54:10 -07:00
CyrusNajmabadi
718dc5b7a8 Merge pull request #3517 from Microsoft/strictMode
Remove 'strict mode' from parsing and checking, and make it purely something purely checked at bind time.
2015-06-15 23:41:41 -07:00
Cyrus Najmabadi
300089ce2d PR feedback. 2015-06-15 23:31:40 -07:00
Cyrus Najmabadi
d558e42d94 External modules are always in strict mode in ES6 2015-06-15 18:20:44 -07:00
Cyrus Najmabadi
dcbfa6988a Modules are always in strict mode in ES6. 2015-06-15 18:01:18 -07:00
Cyrus Najmabadi
417cfa5c2c Check namespaces for strict mode. 2015-06-15 17:48:15 -07:00
Cyrus Najmabadi
ec9e461869 Remove 'strict mode' from parsing and checking, and make it purely something purely checked at bind time. 2015-06-15 17:31:15 -07:00
Arthur Ozga
1954322155 Fixed some indentation issues 2015-06-15 17:10:53 -07:00
Arthur Ozga
506349f9c5 Fix merge conflicts with master 2015-06-15 16:48:09 -07:00
Arthur Ozga
5316d0d0df Abstract keyword: Added parsing and some checks
keyword `abstract` is parsed at the head of class declarations and as a modifier for class member functions/variables.

The following checks have been implemented:
* Objects whose type is an abstract class cannot be instantiated with `new`.
* all overloads of a function must match w/r/t having the abstract keyword.
* a member/class decl can't use the `abstract` keyword multiple times.
* a member can't be both `abstract` and `static`.
* a member can't be both `abstract` and `private`.
* Accessibility modifiers can't follow `abstract`
* Only classes and member functions can be declared abstract.
* abstract methods don't need an implementation
* abstract methods can only appear in abstract classes.

TODO:

* forbid abstract methods from having an implementation.
* make sure, barring overriding, an inherited method is abstract iff it is abstract in the parent.
* If a class has an abstract members, then it must be abstract. (eg: class B does not implement inherited member 'foo()')
* prevent overriding a non-abstract method with an abstract method.
* update "abstractness" flag when overriding abstract method with non-abstract method.
* prevent calling an abstract method via super.<abstract method name>()
* make all overloads of an abstract method adjacent to eachother.
* constructors can't be declared abstract -- give appropriate error.
* figure out what to emit to the *.ts file -- probably nothing.
* figure out what to emit to the *.d.ts file.
* process abstract declarations.
2015-06-15 16:29:34 -07:00
Anders Hejlsberg
186f52572b Accepting new baselines 2015-06-15 16:14:28 -07:00
Anders Hejlsberg
d5752592ac Adding basic tests 2015-06-15 16:14:01 -07:00
Anders Hejlsberg
367e257928 Accepting new baselines 2015-06-15 15:46:29 -07:00
Anders Hejlsberg
cc81cc77f9 Check that base constructor return types are identical
Treat class extends clause as expression position in services.ts
2015-06-15 15:44:43 -07:00
Anders Hejlsberg
2a1b8989be Merge pull request #3509 from Microsoft/simplerStrictModeChecking
Simpler strict mode checking
2015-06-15 12:40:01 -07:00
Anders Hejlsberg
956d73ef5e Accepting new baselines 2015-06-15 10:44:21 -07:00
Anders Hejlsberg
80ea68701b Use instantiated signatures in super calls 2015-06-15 10:27:59 -07:00
Anders Hejlsberg
c20f6820b7 Adding SyntaxKind.BindingElement case 2015-06-15 06:48:48 -07:00
Daniel Rosenwasser
46a842e19b Merge pull request #3049 from Microsoft/testPerf
Create "light" test-running mode and a '--noLibCheck' flag
2015-06-14 20:25:03 -07:00
Daniel Rosenwasser
c2fa08b2ce Removed TypeCheckerHost extension. 2015-06-14 20:06:22 -07:00
Daniel Rosenwasser
5054596884 Just explicitly use Harness.lightMode. 2015-06-14 20:02:20 -07:00
Daniel Rosenwasser
dc6a9bdbee Style. 2015-06-14 19:56:48 -07:00
Daniel Rosenwasser
75920657b9 Updated baselines. 2015-06-14 19:50:13 -07:00
Daniel Rosenwasser
5f01c09b7e Use reference comments again. 2015-06-14 19:49:50 -07:00
Anders Hejlsberg
a826215c0d Accepting new baselines 2015-06-14 14:35:22 -07:00
Anders Hejlsberg
3e9206aaab Consolidating strict mode reserved identifier checking in single method in binder 2015-06-14 14:25:26 -07:00
Anders Hejlsberg
dfa149457c Allow expressions in extends clause of class 2015-06-14 07:10:25 -07:00
Daniel Rosenwasser
5da701ceb1 Updated comment. 2015-06-12 17:53:35 -07:00
Mohamed Hegazy
60e855e252 Merge pull request #3492 from Microsoft/useTypePredicatesInLib
Define Array.isArray using a type predicate
2015-06-12 17:39:31 -07:00
Daniel Rosenwasser
e4dac026b4 Accepted baselines. 2015-06-12 17:33:58 -07:00
Daniel Rosenwasser
cfdccf40c8 Never mess with the file list in tests. 2015-06-12 17:33:29 -07:00
Daniel Rosenwasser
1f4812f9dd Merge branch 'testPerf2' into testPerf
Conflicts:
	src/compiler/program.ts
	src/compiler/types.ts
	src/harness/harness.ts
2015-06-12 16:39:03 -07:00
Daniel Rosenwasser
e1c1da578c Merge branch 'master' into testPerf2
Conflicts:
	Jakefile.js
	src/compiler/program.ts
	src/compiler/types.ts
	src/harness/harness.ts
	src/harness/projectsRunner.ts
	src/harness/runner.ts
2015-06-12 16:16:09 -07:00
Daniel Rosenwasser
b5e57e11e7 Spelling. 2015-06-12 15:50:16 -07:00
Daniel Rosenwasser
fb1421991f Remove unused 'assertInvariants' parameter. 2015-06-12 15:28:54 -07:00