Make "this" the implicit receiver!

This commit is contained in:
Bob Nystrom
2014-02-12 17:33:35 -08:00
parent 92971d1cfa
commit 756fe0d920
13 changed files with 217 additions and 51 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
class Foo {
getClosure {
return fn {
return this.toString
return toString
}
}
+3 -3
View File
@@ -1,13 +1,13 @@
class Outer {
method {
IO.print(this.toString) // expect: Outer
IO.print(this) // expect: Outer
fn {
IO.print(this.toString) // expect: Outer
IO.print(this) // expect: Outer
class Inner {
method {
IO.print(this.toString) // expect: Inner
IO.print(this) // expect: Inner
}
toString { return "Inner" }
}
+1 -1
View File
@@ -3,7 +3,7 @@ class Foo {
return fn {
return fn {
return fn {
return this.toString
return toString
}
}
}