refactor: remove builtin import_ method from String class and inline module loading in compiler

The import_ method on String was a builtin that combined module loading and variable lookup. This change removes that method and instead emits separate bytecode instructions in the compiler: first calling loadModule_ on the module, then calling import_ on the module with the variable name. The native function string_lookUpVariable is renamed to string_import to match the new import_ method name on String's metaclass.
This commit is contained in:
Bob Nystrom
2015-02-16 18:21:29 +00:00
parent 2082b64454
commit d5149f9a74
3 changed files with 9 additions and 15 deletions
+1 -6
View File
@@ -58,12 +58,7 @@ class Sequence {
}
}
class String is Sequence {
import_(variable) {
loadModule_
return lookUpVariable_(variable)
}
}
class String is Sequence {}
class List is Sequence {
addAll(other) {