Don't allow method names to overflow.

This commit is contained in:
Bob Nystrom
2013-12-06 20:09:43 -08:00
parent 6a0d550562
commit 3f24515496
6 changed files with 54 additions and 25 deletions
+11
View File
@@ -0,0 +1,11 @@
// Unicode characters are allowed in comments.
//
// Latin 1 Supplement: £§¶ÜÞ
// Latin Extended-A: ĐĦŋœ
// Latin Extended-B: ƂƢƩǁ
// Other stuff: ឃᢆ᯽₪ℜ↩⊗┺░
// Emoji: ☃☺♣
// TODO(bob): What about combining characters?
io.write("ok") // expect: ok
+4
View File
@@ -0,0 +1,4 @@
// Don't want to actually execute it.
if (false) {
0.thisIsAMethodNameThatExceedsTheMaximumNameLengthOf64CharactersBy1 // expect error
}
+7
View File
@@ -0,0 +1,7 @@
class Foo {
thisHasAMethodNameThatIsExactly64CharactersLongWhichIsTheMaximum {
return "result"
}
}
io.write(Foo.new.thisHasAMethodNameThatIsExactly64CharactersLongWhichIsTheMaximum) // expect: result
+5
View File
@@ -0,0 +1,5 @@
class Foo {
thisIsAMethodNameThatExceedsTheMaximumNameLengthOf64CharactersBy1 { // expect error
"body"
}
}