#include "edge.h" Handle stringCLR2V8(MonoString* text) { NanEscapableScope(); return NanEscapeScope(NanNew( (uint16_t*)mono_string_chars(text), mono_string_length(text))); } MonoString* stringV82CLR(Handle text) { NanScope(); String::Utf8Value utf8text(text); return mono_string_new(mono_domain_get(), *utf8text); } MonoString* exceptionV82stringCLR(Handle exception) { NanScope(); if (exception->IsObject()) { Handle stack = exception->ToObject()->Get(NanNew("stack")); if (stack->IsString()) { return stringV82CLR(stack->ToString()); } } return stringV82CLR(Handle::Cast(exception)); } Handle throwV8Exception(Handle exception) { NanEscapableScope(); NanThrowError(exception); return NanEscapeScope(exception); } // vim: ts=4 sw=4 et: