X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/4b645e23d2abde4de1ced347750b070f89b685c3..55d15e4157686689f89a14aae6b8bb359ae2c6c1:/JavaScript.hpp?ds=sidebyside diff --git a/JavaScript.hpp b/JavaScript.hpp index c75fd7c..8b58024 100644 --- a/JavaScript.hpp +++ b/JavaScript.hpp @@ -1,5 +1,5 @@ -/* Cycript - Optimizing JavaScript Compiler/Runtime - * Copyright (C) 2009-2015 Jay Freeman (saurik) +/* Cycript - The Truly Universal Scripting Language + * Copyright (C) 2009-2016 Jay Freeman (saurik) */ /* GNU Affero General Public License, Version 3 {{{ */ @@ -41,6 +41,7 @@ #include "String.hpp" extern JSStringRef Array_s; +extern JSStringRef constructor_s; extern JSStringRef cy_s; extern JSStringRef cyi_s; extern JSStringRef cyt_s; @@ -63,9 +64,12 @@ JSObjectRef CYGetGlobalObject(JSContextRef context); extern "C" void CYSetupContext(JSGlobalContextRef context); const char *CYExecute(JSContextRef context, CYPool &pool, CYUTF8String code); + +#ifndef __ANDROID__ void CYCancel(); +#endif -void CYSetArgs(int argc, const char *argv[]); +void CYSetArgs(const char *argv0, const char *script, int argc, const char *argv[]); bool CYCastBool(JSContextRef context, JSValueRef value); double CYCastDouble(JSContextRef context, JSValueRef value); @@ -180,6 +184,11 @@ class CYJSString { } public: + CYJSString() : + string_(NULL) + { + } + CYJSString(const CYJSString &rhs) : string_(CYCopyJSString(rhs.string_)) { @@ -203,6 +212,11 @@ class CYJSString { return *this; } + CYJSString &operator =(CYJSString &&rhs) { + std::swap(string_, rhs.string_); + return *this; + } + ~CYJSString() { Clear_(); }