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

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

Issue 6460038: Version 3.1.3.... (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 10 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/x64/macro-assembler-x64.cc ('k') | test/cctest/test-disasm-ia32.cc » ('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-2009 the V8 project authors. All rights reserved. 1 // Copyright 2007-2009 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 12531 matching lines...) Expand 10 before | Expand all | Expand 10 after
12542 v8::Context::Scope context_scope(context.local()); 12542 v8::Context::Scope context_scope(context.local());
12543 12543
12544 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); 12544 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New();
12545 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator); 12545 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator);
12546 context->Global()->Set(v8_str("o"), tmpl->NewInstance()); 12546 context->Global()->Set(v8_str("o"), tmpl->NewInstance());
12547 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun( 12547 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun(
12548 "var result = []; for (var k in o) result.push(k); result")); 12548 "var result = []; for (var k in o) result.push(k); result"));
12549 CHECK_EQ(1, result->Length()); 12549 CHECK_EQ(1, result->Length());
12550 CHECK_EQ(v8_str("universalAnswer"), result->Get(0)); 12550 CHECK_EQ(v8_str("universalAnswer"), result->Get(0));
12551 } 12551 }
12552
12553
12554 TEST(DefinePropertyPostDetach) {
12555 v8::HandleScope scope;
12556 LocalContext context;
12557 v8::Handle<v8::Object> proxy = context->Global();
12558 v8::Handle<v8::Function> define_property =
12559 CompileRun("(function() {"
12560 " Object.defineProperty("
12561 " this,"
12562 " 1,"
12563 " { configurable: true, enumerable: true, value: 3 });"
12564 "})").As<Function>();
12565 context->DetachGlobal();
12566 define_property->Call(proxy, 0, NULL);
12567 }
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.cc ('k') | test/cctest/test-disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698