Sirikata
|
Go to the source code of this file.
Namespaces | |
namespace | Sirikata |
Note: All the classes provided in this file are thin wrappers around the corresponding classes in ASIO. | |
namespace | Sirikata::JS |
Defines | |
#define | JS_STRING(x) (v8::String::New( #x )) |
#define | NumericCheckAndExtract(native, value) |
#define | StringCheckAndExtract(native, value) |
#define | ObjectCheckAndCast(result, value) |
#define | FunctionCheckAndCast(result, value) |
Functions | |
bool | Sirikata::JS::StringValidate (const Handle< Value > &val) |
std::string | Sirikata::JS::StringExtract (const Handle< Value > &val) |
bool | Sirikata::JS::NumericValidate (const Handle< Value > &val) |
double | Sirikata::JS::NumericExtract (const Handle< Value > &val) |
Handle< Value > | Sirikata::JS::CreateJSResult (Handle< Object > &orig, const double &src) |
Handle< Value > | Sirikata::JS::CreateJSResult (v8::Handle< v8::Context > &ctx, const double &src) |
Handle< Value > | Sirikata::JS::CreateJSResult (Handle< Object > &orig, const float &src) |
Handle< Value > | Sirikata::JS::CreateJSResult (v8::Handle< v8::Context > &ctx, const float &src) |
v8::Handle< v8::Object > | Sirikata::JS::ObjectCast (const v8::Handle< v8::Value > &v) |
v8::Handle< v8::Function > | Sirikata::JS::FunctionCast (const v8::Handle< v8::Value > &v) |
Handle< Value > | Sirikata::JS::GetGlobal (v8::Handle< v8::Context > &ctx, const char *obj_name) |
String | Sirikata::JS::FromV8String (const v8::String::Utf8Value &v8str) |
#define FunctionCheckAndCast | ( | result, | |
value | |||
) |
if (!value->IsFunction()) \ return v8::ThrowException( v8::Exception::TypeError(v8::String::New("Expected function.")) ); \ Handle<Function> result = Handle<Function>::Cast(value);
#define JS_STRING | ( | x | ) | (v8::String::New( #x )) |
Referenced by Sirikata::JS::CreateJSResult(), Sirikata::JS::CreateJSResult_Vec3Impl(), Sirikata::JS::JSObjectScriptManager::createSystemTemplate(), Sirikata::JS::JSObjectScriptManager::createUtilTemplate(), Sirikata::JS::QuaternionExtract(), Sirikata::JS::QuaternionFill(), Sirikata::JS::QuaternionValidate(), Sirikata::JS::Vec3Extract(), Sirikata::JS::Vec3ExtractF(), Sirikata::JS::Vec3Fill(), and Sirikata::JS::Vec3Validate().
#define NumericCheckAndExtract | ( | native, | |
value | |||
) |
if (!NumericValidate(value)) \ return v8::ThrowException( v8::Exception::TypeError(v8::String::New("Value couldn't be interpreted as numeric.")) ); \ double native = NumericExtract(value);
Referenced by Sirikata::JS::QuaternionConstructor(), and Sirikata::JS::Vec3Constructor().
#define ObjectCheckAndCast | ( | result, | |
value | |||
) |
if (!value->IsObject()) \ return v8::ThrowException( v8::Exception::TypeError(v8::String::New("Expected object.")) ); \ Handle<Object> result = Handle<Object>::Cast(value);
Referenced by Sirikata::JS::QuaternionConstructor().
#define StringCheckAndExtract | ( | native, | |
value | |||
) |
if (!StringValidate(value)) \ return v8::ThrowException( v8::Exception::TypeError(v8::String::New("Value couldn't be interpreted as string.")) ); \ std::string native = StringExtract(value);
Referenced by Sirikata::JS::JSSystem::commonRequire(), and Sirikata::JS::JSSystem::evalInGlobal().