Get rid of builtin function for importing.

This commit is contained in:
Bob Nystrom
2015-02-16 10:21:29 -08:00
parent 5b1447882b
commit c2c576b27c
3 changed files with 9 additions and 15 deletions
+5 -1
View File
@@ -2911,10 +2911,14 @@ static void import(Compiler* compiler)
wrenNewString(compiler->parser->vm,
compiler->parser->previous.start, compiler->parser->previous.length));
// Call "module".loadModule_
emitShortArg(compiler, CODE_CONSTANT, moduleConstant);
emitShortArg(compiler, CODE_CONSTANT, variableConstant);
emitShortArg(compiler, CODE_CALL_0,
methodSymbol(compiler, "loadModule_", 11));
// Call "module".import_("variable")
emitShortArg(compiler, CODE_CONSTANT, moduleConstant);
emitShortArg(compiler, CODE_CONSTANT, variableConstant);
emitShortArg(compiler, CODE_CALL_1, methodSymbol(compiler, "import_ ", 8));
// Store the result in the variable here.