Generate correct code for locals.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
bar {
|
||||
var a = "value"
|
||||
var a = "other" // expect error
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
bar(arg,
|
||||
arg) { // expect error
|
||||
"body"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class Foo {
|
||||
bar(a) {
|
||||
var a = "oops" // expect error
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
class Foo {
|
||||
bar {
|
||||
var a = "a"
|
||||
io.write(a) // expect: a
|
||||
var b = a + " b"
|
||||
io.write(b) // expect: a b
|
||||
var c = a + " c"
|
||||
io.write(c) // expect: a c
|
||||
var d = b + " d"
|
||||
io.write(d) // expect: a b d
|
||||
}
|
||||
}
|
||||
|
||||
Foo.new.bar
|
||||
Reference in New Issue
Block a user