Commit graph

22 commits

Author SHA1 Message Date
Nathan Shively-Sanders 43fc19c958
Emit statements before super (#36417)
* Emit statements before super

When statements come before super, Typescript's emit is incorrect,
whether there is an error or not. This change preserves statements that
come before super whether there is an error or not.

Here is the case with no errors:

```ts
class Test extends Array {
  p: number
  constructor() {
    console.log("p is initialised in the constructor below super()")
    super()
    this.p = 1
  }
}
```

Notice that `p` is manually initialised in the constructor after
`super()` instead of at the property declaration.

* Update baselines

Parameter properties in the error case now move below the super call.
This is an improvement because it means the code is more likely to execute
correctly.

* remove outdated comments
2020-01-24 14:52:48 -08:00
Andrew Branch 4f3412153a
Parse quoted constructors as constructors, not methods (#31949)
* Parse quoted constructors as constructors, not methods

* Update baselines

* Fix disambiguation between quoted constructor and property named constructor

* Clean up parsing a bit

* Support escapes in constructor name

* Update baselines
2019-07-12 14:01:57 -07:00
Andrew Branch c5e6913ede
Add grammar error on quoted constructors for TS 3.5 2019-04-25 15:44:23 -07:00
Andrew Branch 72f30a8308
Add test for quoted constructors 2019-04-25 11:35:10 -07:00
Ron Buckton f89156bf55 Add error for super property before super 2016-12-06 10:47:02 -08:00
Kanchalai Tanglertsampan dc501f47c2 Update baselines 2016-09-15 09:21:14 -07:00
Nathan Shively-Sanders 2169928f2b Protected constructors now accessible everywhere in subclasses 2016-07-22 17:38:25 -07:00
Nathan Shively-Sanders 25525607d5 Test that protected constructors are accessible
in static methods of subclasses
2016-07-22 13:38:45 -07:00
Andy Hanson 17009e41d4 Expand tests 2016-05-23 06:06:01 -07:00
Andy Hanson dcbaadaa60 Allow assignment to readonly parameter property within the constructor 2016-05-20 08:54:05 -07:00
Andy Hanson 40afe4a4dd Don't report error twice for readonly in method 2016-05-12 07:07:35 -07:00
Andy Hanson 02f2ed798f Add declaration emit tests for readonly parameter property 2016-05-12 07:07:34 -07:00
Andy Hanson ad2634e343 Fix #7590: Allow 'readonly' to be used in constructor parameters 2016-05-11 08:32:17 -07:00
AbubakerB 208830efa3 Updated tests and accepted baseline 2016-02-13 02:52:25 +00:00
AbubakerB ec7e80e377 Added tests and accept baselines 2016-02-13 01:10:47 +00:00
AbubakerB 4c93eb2e98 Accept baselines 2016-02-04 21:00:50 +00:00
AbubakerB c351ffcc75 Added and updated tests for constructor visibility 2016-02-03 22:48:33 +00:00
Yui T c2fb694404 Update baselines 2015-11-30 09:43:30 -08:00
Yui T c2d86711e8 Update baselines 2014-09-30 18:09:55 -07:00
Mohamed Hegazy a6fdad1e97 Added protected conformance tests 2014-09-23 11:22:38 -07:00
Anders Hejlsberg b5b0777ad5 More tests for protected members 2014-09-19 14:01:07 -07:00
Mohamed Hegazy 214df64e28 Add snapshot of compiler sources 2014-07-12 17:30:19 -07:00