1.1 --- a/src/API.cpp Sat Dec 22 18:25:31 2012 -0800
1.2 +++ b/src/API.cpp Sat Dec 22 19:48:43 2012 -0800
1.3 @@ -91,7 +91,7 @@
1.4 return Ke::Local<To>(reinterpret_cast<To *>(Ke::HandleScope::CreateHandle(from)));
1.5 }
1.6
1.7 -ke::Module *
1.8 +bool
1.9 InternalCompile(const char *path)
1.10 {
1.11 PoolScope poolScope(ZONE()->pool());
1.12 @@ -102,36 +102,20 @@
1.13 unit->path_ = path;
1.14
1.15 if (!cc.addTranslationUnit(unit))
1.16 - return NULL;
1.17 + return false;
1.18
1.19 if (!cc.compile())
1.20 - return NULL;
1.21 -
1.22 - return NULL;
1.23 + return false;
1.24
1.25 -#if 0
1.26 - ke::Local<ke::Module> module(ZONE(), CompileFromSource(cc, path, bytes, length));
1.27 - delete [] bytes;
1.28 - if (!module)
1.29 - return NULL;
1.30 -
1.31 - ke::Local<ke::String> pathstr(ZONE(), ke::String::New(ZONE(), path, Heap::Tenure_Old));
1.32 - if (!pathstr)
1.33 - return NULL;
1.34 -
1.35 - module->setPath(pathstr);
1.36 - return module;
1.37 -#endif
1.38 - return NULL;
1.39 + return true;
1.40 }
1.41
1.42 // This is split out from InternalCompile so the RootScope doesn't conflict
1.43 // with making a return handle.
1.44 -Ke::Local<Ke::Module>
1.45 +bool
1.46 Ke::Compile(const char *path)
1.47 {
1.48 - ke::Local<ke::Module> module(ZONE(), InternalCompile(path));
1.49 - return ToLocal<ke::Module, Ke::Module>(module);
1.50 + return InternalCompile(path);
1.51 }
1.52
1.53 void