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

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

Issue 11190050: Heavy cleanup of the external pointer API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 1 month 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 | « test/cctest/test-debug.cc ('k') | tools/grokdump.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. 1 // Copyright 2007-2008 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 v8::Handle<Integer> DeclarationContext::HandleQuery(Local<String> key, 184 v8::Handle<Integer> DeclarationContext::HandleQuery(Local<String> key,
185 const AccessorInfo& info) { 185 const AccessorInfo& info) {
186 DeclarationContext* context = GetInstance(info); 186 DeclarationContext* context = GetInstance(info);
187 context->query_count_++; 187 context->query_count_++;
188 return context->Query(key); 188 return context->Query(key);
189 } 189 }
190 190
191 191
192 DeclarationContext* DeclarationContext::GetInstance(const AccessorInfo& info) { 192 DeclarationContext* DeclarationContext::GetInstance(const AccessorInfo& info) {
193 return static_cast<DeclarationContext*>(External::Unwrap(info.Data())); 193 void* value = External::Cast(*info.Data())->Value();
194 return static_cast<DeclarationContext*>(value);
194 } 195 }
195 196
196 197
197 v8::Handle<Value> DeclarationContext::Get(Local<String> key) { 198 v8::Handle<Value> DeclarationContext::Get(Local<String> key) {
198 return v8::Handle<Value>(); 199 return v8::Handle<Value>();
199 } 200 }
200 201
201 202
202 v8::Handle<Value> DeclarationContext::Set(Local<String> key, 203 v8::Handle<Value> DeclarationContext::Set(Local<String> key,
203 Local<Value> value) { 204 Local<Value> value) {
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 EXPECT_ERROR); 898 EXPECT_ERROR);
898 } 899 }
899 900
900 { SimpleContext context; 901 { SimpleContext context;
901 context.Check("const x = 1; x", 902 context.Check("const x = 1; x",
902 EXPECT_RESULT, Number::New(1)); 903 EXPECT_RESULT, Number::New(1));
903 context.Check("function x() { return 2 }; x()", 904 context.Check("function x() { return 2 }; x()",
904 EXPECT_ERROR); 905 EXPECT_ERROR);
905 } 906 }
906 } 907 }
OLDNEW
« no previous file with comments | « test/cctest/test-debug.cc ('k') | tools/grokdump.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698