Correctly count subscript parameters in wrenMakeCallHandle().

Fixes #351.
This commit is contained in:
Bob Nystrom
2016-05-04 06:29:44 -07:00
parent 3b7446738c
commit 2ce5913501
3 changed files with 66 additions and 4 deletions
+20
View File
@@ -21,12 +21,32 @@ class Call {
}
static getValue() { ["a", "b"] }
static - {
System.print("unary")
}
static -(arg) {
System.print("binary %(arg)")
}
static [one, two] {
System.print("subscript %(one) %(two)")
}
static [one, two]=(three) {
System.print("subscript set %(one) %(two) %(three)")
}
}
// expect: noParams
// expect: zero
// expect: one 1
// expect: two 1 2
// expect: unary
// expect: binary 1
// expect: subscript 1 2
// expect: subscript set 1 2 3
// expect: two true false
// expect: two 1.2 3.4