internal JSValue(JSContext context, V8Response r) { this.jsContext = context; this.context = context.context; r.ThrowError(); this.handle = r; }
internal static void ThrowError(this V8Response r) { if (r.Type == V8HandleType.Error || r.Type == V8HandleType.ConstError) { var msg = r.StringValue; throw new JavaScriptException(msg); } }
internal static int GetIntegerValue(this V8Response r) { ThrowError(r); if (r.Type != V8HandleType.Integer) { // JSContext.V8Context_Release(r); throw new NotSupportedException(); } return(r.result.intValue); }
internal static bool GetBooleanValue(this V8Response r) { ThrowError(r); if (r.Type != V8HandleType.Boolean) { // JSContext.V8Context_Release(r); throw new NotSupportedException(); } return(r.result.booleanValue); }