
v8
文章平均质量分 50
headool
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
v8 hack ---给js添加新的关键字
ECMAScript的关键字是js关键字的子集。参考资料点击打开链接;点击打开链接 下文将给v8的添加js关键字func,func的用法与function相同。 1.打开v8/src/scanner.cc文件。 2.找到function的token转换地方 3.在它之上插入func的token,如下所示: 退到v8根目录下重新编译: make -j4 native i1原创 2013-11-16 08:46:18 · 1129 阅读 · 0 评论 -
v8学习---使用内部字段给js添加全局变量
#include #include using namespace v8; void Setter(Local property, Local value, const PropertyCallbackInfo& info) { Local self = info.Holder(); Local wrap = Local::Cast(self->GetInternalField(0))原创 2013-11-10 23:09:48 · 1513 阅读 · 0 评论 -
v8学习---添加js全局变量
#include using namespace v8; int x = 9527; void XGetter(Local property, const PropertyCallbackInfo& info) { info.GetReturnValue().Set(Integer::New(x)); } void XSetter(Local property, Local value,原创 2013-11-10 11:40:41 · 1425 阅读 · 0 评论 -
v8学习---添加带参数js全局函数
#include using namespace v8; void log(const v8::FunctionCallbackInfo& args) { String::AsciiValue ascii(args[0]); printf("%s\n", *ascii); } int main() { Isolate* isolate = Isolate::GetCur原创 2013-11-10 10:24:11 · 1068 阅读 · 0 评论 -
v8学习---添加js全局函数
#include using namespace v8; void test(const v8::FunctionCallbackInfo& args) { printf("Hello Headool\n"); } int main() { Isolate* isolate = Isolate::GetCurrent(); HandleScope handleSco原创 2013-11-10 10:11:19 · 2305 阅读 · 0 评论 -
v8学习---获取js变量的值
#include using namespace v8; int main() { Isolate* isolate = Isolate::GetCurrent(); HandleScope handleScope(isolate); Handle context = Context::New(isolate); Context::Scope context_s原创 2013-11-04 00:38:49 · 1371 阅读 · 0 评论 -
v8学习---Hello world
完全抄自v8文档 #include using namespace v8; int main(int argc, char* argv[]) { // Get the default Isolate created at startup. Isolate* isolate = Isolate::GetCurrent(); // Create a stack-allocat转载 2013-11-03 19:28:59 · 869 阅读 · 0 评论 -
v8学习---获取全局对象成员
参考:http://iammr.7.blog.163.com/blog/static/49102699201201565822189/ 获取全局对象成员 #include using namespace v8; int main() { Isolate* isolate = Isolate::GetCurrent(); HandleScope handleScope(isolate);原创 2013-11-05 22:56:40 · 1155 阅读 · 0 评论 -
v8学习---判断是否为函数或对象
#include using namespace v8; int main() { Isolate* isolate = Isolate::GetCurrent(); HandleScope handleScope(isolate); Handle context = Context::New(isolate); Context::Scope context_s原创 2013-11-10 09:13:41 · 896 阅读 · 0 评论 -
v8学习---js整数转c++ int
#include using namespace v8; int main() { Isolate* isolate = Isolate::GetCurrent(); HandleScope handleScope(isolate); Handle context = Context::New(isolate); Context::Scope context_s原创 2013-11-10 09:34:35 · 1487 阅读 · 0 评论 -
v8学习---c++调用js构造函数
#include using namespace v8; int main() { Isolate* isolate = Isolate::GetCurrent(); HandleScope handleScope(isolate); Handle context = Context::New(isolate); Context::Scope context_s原创 2013-11-10 01:02:57 · 1723 阅读 · 0 评论 -
v8学习---c++调用javascript的方法
#include using namespace v8; int main() { Isolate* isolate = Isolate::GetCurrent(); HandleScope handleScope(isolate); Handle context = Context::New(isolate); Context::Scope context_scope(context)原创 2013-11-06 00:22:31 · 1548 阅读 · 0 评论 -
v8学习---添加有返回值的js全局函数
#include using namespace v8; void get_name(const v8::FunctionCallbackInfo& args) { args.GetReturnValue().Set(String::New("Headool")); } int main() { Isolate* isolate = Isolate::GetCurrent();原创 2013-11-10 10:55:03 · 1892 阅读 · 0 评论