1 // Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WRT_XWALK_JS_UTILS_H_
6 #define WRT_XWALK_JS_UTILS_H_
10 #include <EWebKit_internal.h>
11 #include <JavaScriptCore/JavaScript.h>
17 JSValueRef ToJSValueRef(JSContextRef ctx, const std::string& str);
18 void SetProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef value, JSPropertyAttributes attributes, JSValueRef *exception);
19 void DeleteProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef *exception);
20 JSValueRef GetProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef *exception);
21 std::string JSValueToString(JSContextRef ctx, JSValueRef value);
22 std::string ExceptionToString(JSContextRef ctx, JSValueRef exception);
23 JSValueRef RunString(JSContextRef ctx, const std::string& code,std::string* exception);