OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 | 836 |
837 TestApiCallbacks callbacks(100); | 837 TestApiCallbacks callbacks(100); |
838 v8::Local<v8::External> data = | 838 v8::Local<v8::External> data = |
839 v8::External::New(env->GetIsolate(), &callbacks); | 839 v8::External::New(env->GetIsolate(), &callbacks); |
840 | 840 |
841 v8::Local<v8::FunctionTemplate> func_template = v8::FunctionTemplate::New(); | 841 v8::Local<v8::FunctionTemplate> func_template = v8::FunctionTemplate::New(); |
842 func_template->SetClassName( | 842 func_template->SetClassName( |
843 v8::String::NewFromUtf8(env->GetIsolate(), "Test_InstanceCostructor")); | 843 v8::String::NewFromUtf8(env->GetIsolate(), "Test_InstanceCostructor")); |
844 v8::Local<v8::ObjectTemplate> proto_template = | 844 v8::Local<v8::ObjectTemplate> proto_template = |
845 func_template->PrototypeTemplate(); | 845 func_template->PrototypeTemplate(); |
846 v8::Local<v8::Signature> signature = v8::Signature::New(func_template); | 846 v8::Local<v8::Signature> signature = |
| 847 v8::Signature::New(env->GetIsolate(), func_template); |
847 proto_template->Set(v8::String::NewFromUtf8(env->GetIsolate(), "fooMethod"), | 848 proto_template->Set(v8::String::NewFromUtf8(env->GetIsolate(), "fooMethod"), |
848 v8::FunctionTemplate::New(&TestApiCallbacks::Callback, | 849 v8::FunctionTemplate::New(&TestApiCallbacks::Callback, |
849 data, signature, 0)); | 850 data, signature, 0)); |
850 | 851 |
851 v8::Local<v8::Function> func = func_template->GetFunction(); | 852 v8::Local<v8::Function> func = func_template->GetFunction(); |
852 v8::Local<v8::Object> instance = func->NewInstance(); | 853 v8::Local<v8::Object> instance = func->NewInstance(); |
853 env->Global()->Set(v8::String::NewFromUtf8(env->GetIsolate(), "instance"), | 854 env->Global()->Set(v8::String::NewFromUtf8(env->GetIsolate(), "instance"), |
854 instance); | 855 instance); |
855 | 856 |
856 v8::Script::Compile(v8::String::NewFromUtf8( | 857 v8::Script::Compile(v8::String::NewFromUtf8( |
(...skipping 22 matching lines...) Expand all Loading... |
879 | 880 |
880 TestApiCallbacks callbacks(1); | 881 TestApiCallbacks callbacks(1); |
881 v8::Local<v8::External> data = | 882 v8::Local<v8::External> data = |
882 v8::External::New(env->GetIsolate(), &callbacks); | 883 v8::External::New(env->GetIsolate(), &callbacks); |
883 | 884 |
884 v8::Local<v8::FunctionTemplate> func_template = v8::FunctionTemplate::New(); | 885 v8::Local<v8::FunctionTemplate> func_template = v8::FunctionTemplate::New(); |
885 func_template->SetClassName( | 886 func_template->SetClassName( |
886 v8::String::NewFromUtf8(env->GetIsolate(), "Test_InstanceCostructor")); | 887 v8::String::NewFromUtf8(env->GetIsolate(), "Test_InstanceCostructor")); |
887 v8::Local<v8::ObjectTemplate> proto_template = | 888 v8::Local<v8::ObjectTemplate> proto_template = |
888 func_template->PrototypeTemplate(); | 889 func_template->PrototypeTemplate(); |
889 v8::Local<v8::Signature> signature = v8::Signature::New(func_template); | 890 v8::Local<v8::Signature> signature = |
| 891 v8::Signature::New(env->GetIsolate(), func_template); |
890 proto_template->Set(v8::String::NewFromUtf8(env->GetIsolate(), "fooMethod"), | 892 proto_template->Set(v8::String::NewFromUtf8(env->GetIsolate(), "fooMethod"), |
891 v8::FunctionTemplate::New(&TestApiCallbacks::Callback, | 893 v8::FunctionTemplate::New(&TestApiCallbacks::Callback, |
892 data, signature, 0)); | 894 data, signature, 0)); |
893 | 895 |
894 v8::Local<v8::Function> func = func_template->GetFunction(); | 896 v8::Local<v8::Function> func = func_template->GetFunction(); |
895 v8::Local<v8::Object> instance = func->NewInstance(); | 897 v8::Local<v8::Object> instance = func->NewInstance(); |
896 env->Global()->Set(v8::String::NewFromUtf8(env->GetIsolate(), "instance"), | 898 env->Global()->Set(v8::String::NewFromUtf8(env->GetIsolate(), "instance"), |
897 instance); | 899 instance); |
898 | 900 |
899 v8::Script::Compile(v8::String::NewFromUtf8( | 901 v8::Script::Compile(v8::String::NewFromUtf8( |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 const v8::CpuProfileNode* baz = GetChild(env->GetIsolate(), script, "baz"); | 1530 const v8::CpuProfileNode* baz = GetChild(env->GetIsolate(), script, "baz"); |
1529 CheckFunctionDetails(env->GetIsolate(), baz, "baz", "script_b", | 1531 CheckFunctionDetails(env->GetIsolate(), baz, "baz", "script_b", |
1530 script_b->GetId(), 3, 16); | 1532 script_b->GetId(), 3, 16); |
1531 const v8::CpuProfileNode* foo = GetChild(env->GetIsolate(), baz, "foo"); | 1533 const v8::CpuProfileNode* foo = GetChild(env->GetIsolate(), baz, "foo"); |
1532 CheckFunctionDetails(env->GetIsolate(), foo, "foo", "script_a", | 1534 CheckFunctionDetails(env->GetIsolate(), foo, "foo", "script_a", |
1533 script_a->GetId(), 2, 1); | 1535 script_a->GetId(), 2, 1); |
1534 const v8::CpuProfileNode* bar = GetChild(env->GetIsolate(), foo, "bar"); | 1536 const v8::CpuProfileNode* bar = GetChild(env->GetIsolate(), foo, "bar"); |
1535 CheckFunctionDetails(env->GetIsolate(), bar, "bar", "script_a", | 1537 CheckFunctionDetails(env->GetIsolate(), bar, "bar", "script_a", |
1536 script_a->GetId(), 3, 14); | 1538 script_a->GetId(), 3, 14); |
1537 } | 1539 } |
OLD | NEW |