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

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

Issue 240573004: Allow Object.defineProperty to update value of an API accessor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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/runtime.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 9378 matching lines...) Expand 10 before | Expand all | Expand 10 after
9389 CompileRun("Object.seal(other)"); 9389 CompileRun("Object.seal(other)");
9390 ExpectTrue("Object.isExtensible(other)"); 9390 ExpectTrue("Object.isExtensible(other)");
9391 9391
9392 // Regression test for issue 1250. 9392 // Regression test for issue 1250.
9393 // Make sure that we can set the accessible accessors value using normal 9393 // Make sure that we can set the accessible accessors value using normal
9394 // assignment. 9394 // assignment.
9395 CompileRun("other.accessible_prop = 42"); 9395 CompileRun("other.accessible_prop = 42");
9396 CHECK_EQ(42, g_echo_value_1); 9396 CHECK_EQ(42, g_echo_value_1);
9397 9397
9398 v8::Handle<Value> value; 9398 v8::Handle<Value> value;
9399 // We follow Safari in ignoring assignments to host object accessors.
9400 CompileRun("Object.defineProperty(other, 'accessible_prop', {value: -1})"); 9399 CompileRun("Object.defineProperty(other, 'accessible_prop', {value: -1})");
9401 value = CompileRun("other.accessible_prop == 42"); 9400 value = CompileRun("other.accessible_prop == 42");
9402 CHECK(value->IsTrue()); 9401 CHECK(value->IsTrue());
9403 } 9402 }
9404 9403
9405 9404
9406 static bool GetOwnPropertyNamesNamedBlocker(Local<v8::Object> global, 9405 static bool GetOwnPropertyNamesNamedBlocker(Local<v8::Object> global,
9407 Local<Value> name, 9406 Local<Value> name,
9408 v8::AccessType type, 9407 v8::AccessType type,
9409 Local<Value> data) { 9408 Local<Value> data) {
(...skipping 13082 matching lines...) Expand 10 before | Expand all | Expand 10 after
22492 v8::internal::FLAG_stack_size = 150; 22491 v8::internal::FLAG_stack_size = 150;
22493 LocalContext current; 22492 LocalContext current;
22494 v8::Isolate* isolate = current->GetIsolate(); 22493 v8::Isolate* isolate = current->GetIsolate();
22495 v8::HandleScope scope(isolate); 22494 v8::HandleScope scope(isolate);
22496 V8::SetCaptureStackTraceForUncaughtExceptions( 22495 V8::SetCaptureStackTraceForUncaughtExceptions(
22497 true, 10, v8::StackTrace::kDetailed); 22496 true, 10, v8::StackTrace::kDetailed);
22498 v8::TryCatch try_catch; 22497 v8::TryCatch try_catch;
22499 CompileRun("(function f(x) { f(x+1); })(0)"); 22498 CompileRun("(function f(x) { f(x+1); })(0)");
22500 CHECK(try_catch.HasCaught()); 22499 CHECK(try_catch.HasCaught());
22501 } 22500 }
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698