Introduced an extra Makefile for the custom javascript interpreter.

This commit is contained in:
Oliver Buchtala 2014-02-26 20:51:38 +01:00
commit b216a739c4
7 changed files with 233 additions and 44 deletions

View file

@ -70,6 +70,10 @@ bool JSCShell::InitializeEngine() {
JSClassRef __shell_class__ = JSClassCreate(&__shell_classdef__);
JSObjectRef __shell__ = JSObjectMake(context, __shell_class__, 0);
bool success = JSObjectSetPrivate(__shell__, (void*) (long) this);
if (!success) {
std::cerr << "Could not register the shell in the Javascript context" << std::endl;
return false;
}
JSStringRef shellKey = JSStringCreateWithUTF8CString("__shell__");
JSObjectSetProperty(context, globalObject, shellKey, __shell__, kJSPropertyAttributeReadOnly, NULL);
JSStringRelease(shellKey);