Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: test/cctest/test-api.cc

Issue 15814005: callback handler map not correctly populated by direct use of SetCallHandler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 22 matching lines...) Expand all
33 #endif // WIN32 33 #endif // WIN32
34 34
35 // TODO(dcarney): remove 35 // TODO(dcarney): remove
36 #define V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR 36 #define V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR
37 #define V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT 37 #define V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT
38 #define V8_ALLOW_ACCESS_TO_PERSISTENT_ARROW 38 #define V8_ALLOW_ACCESS_TO_PERSISTENT_ARROW
39 39
40 #include "v8.h" 40 #include "v8.h"
41 41
42 #include "api.h" 42 #include "api.h"
43 #include "arguments.h"
43 #include "isolate.h" 44 #include "isolate.h"
44 #include "compilation-cache.h" 45 #include "compilation-cache.h"
45 #include "execution.h" 46 #include "execution.h"
46 #include "objects.h" 47 #include "objects.h"
47 #include "snapshot.h" 48 #include "snapshot.h"
48 #include "platform.h" 49 #include "platform.h"
49 #include "utils.h" 50 #include "utils.h"
50 #include "cctest.h" 51 #include "cctest.h"
51 #include "parser.h" 52 #include "parser.h"
52 #include "unicode-inl.h" 53 #include "unicode-inl.h"
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
901 v8::HandleScope scope(env->GetIsolate()); 902 v8::HandleScope scope(env->GetIsolate());
902 Local<v8::FunctionTemplate> fun_templ = 903 Local<v8::FunctionTemplate> fun_templ =
903 v8::FunctionTemplate::New(handler); 904 v8::FunctionTemplate::New(handler);
904 Local<Function> fun = fun_templ->GetFunction(); 905 Local<Function> fun = fun_templ->GetFunction();
905 env->Global()->Set(v8_str("obj"), fun); 906 env->Global()->Set(v8_str("obj"), fun);
906 Local<Script> script = v8_compile("obj()"); 907 Local<Script> script = v8_compile("obj()");
907 for (int i = 0; i < 30; i++) { 908 for (int i = 0; i < 30; i++) {
908 CHECK_EQ(102, script->Run()->Int32Value()); 909 CHECK_EQ(102, script->Run()->Int32Value());
909 } 910 }
910 } 911 }
912 // Blow away handler database
913 i::Isolate* isolate = i::Isolate::Current();
914 if (isolate->callback_table() != NULL) {
915 delete isolate->callback_table();
916 isolate->set_callback_table(NULL);
917 }
911 // Use SetCallHandler to initialize a function template, should work like the 918 // Use SetCallHandler to initialize a function template, should work like the
912 // previous one. 919 // previous one.
913 { 920 {
914 LocalContext env; 921 LocalContext env;
915 v8::HandleScope scope(env->GetIsolate()); 922 v8::HandleScope scope(env->GetIsolate());
916 Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New(); 923 Local<v8::FunctionTemplate> fun_templ = v8::FunctionTemplate::New();
917 fun_templ->SetCallHandler(handler); 924 fun_templ->SetCallHandler(handler);
918 Local<Function> fun = fun_templ->GetFunction(); 925 Local<Function> fun = fun_templ->GetFunction();
919 env->Global()->Set(v8_str("obj"), fun); 926 env->Global()->Set(v8_str("obj"), fun);
920 Local<Script> script = v8_compile("obj()"); 927 Local<Script> script = v8_compile("obj()");
(...skipping 18331 matching lines...) Expand 10 before | Expand all | Expand 10 after
19252 i::Semaphore* sem_; 19259 i::Semaphore* sem_;
19253 volatile int sem_value_; 19260 volatile int sem_value_;
19254 }; 19261 };
19255 19262
19256 19263
19257 THREADED_TEST(SemaphoreInterruption) { 19264 THREADED_TEST(SemaphoreInterruption) {
19258 ThreadInterruptTest().RunTest(); 19265 ThreadInterruptTest().RunTest();
19259 } 19266 }
19260 19267
19261 #endif // WIN32 19268 #endif // WIN32
OLDNEW
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698