forked from Mirror/wren
Test "this" in static methods.
This commit is contained in:
@ -4,7 +4,3 @@ class Foo {
|
||||
}
|
||||
|
||||
IO.print((new Foo).bar.baz) // expect: baz
|
||||
|
||||
// TODO: Test that "this" is the class when in a static method.
|
||||
// (Or disallow "this" in statics? It's useful since statics are
|
||||
// inherited.)
|
||||
|
||||
10
test/this/this_in_static_method.wren
Normal file
10
test/this/this_in_static_method.wren
Normal file
@ -0,0 +1,10 @@
|
||||
class Foo {
|
||||
static test {
|
||||
IO.print(this == Foo) // expect: true
|
||||
IO.print(this.bar) // expect: bar
|
||||
}
|
||||
|
||||
static bar { return "bar" }
|
||||
}
|
||||
|
||||
Foo.test
|
||||
Reference in New Issue
Block a user