Use "construct" instead of "this" to define constructors.

This commit is contained in:
Bob Nystrom
2015-07-21 07:24:53 -07:00
parent ed8ec262e4
commit 71ab3ca887
31 changed files with 68 additions and 81 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
class Foo {
this new() {
construct new() {
_field1 = 1
_field2 = 2
_field3 = 3
+2 -2
View File
@@ -1,5 +1,5 @@
class Foo {
this new() {
construct new() {
_field1 = 1
_field2 = 2
_field3 = 3
@@ -137,7 +137,7 @@ class Foo {
}
class Bar is Foo {
this new() {
construct new() {
super()
_field129 = 129
_field130 = 130
+1 -1
View File
@@ -1,5 +1,5 @@
class Foo {
this new() {
construct new() {
_field1 = 1
_field2 = 2
_field3 = 3
+2 -2
View File
@@ -1,5 +1,5 @@
class Foo {
this new() {
construct new() {
_field1 = 1
_field2 = 2
_field3 = 3
@@ -137,7 +137,7 @@ class Foo {
}
class Bar is Foo { // expect runtime error: Class 'Bar' may not have more than 255 fields, including inherited ones.
this new() {
construct new() {
super()
_field129 = 129
_field130 = 130