OLD | NEW |
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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 "Object.defineProperty(this.__proto__, 'x', {" | 571 "Object.defineProperty(this.__proto__, 'x', {" |
572 " get : function() { return this; }," | 572 " get : function() { return this; }," |
573 " set : function() { set_value = this; }" | 573 " set : function() { set_value = this; }" |
574 "});" | 574 "});" |
575 "function getter() { return x; }" | 575 "function getter() { return x; }" |
576 "function setter() { x = 1; }" | 576 "function setter() { x = 1; }" |
577 "for (var i = 0; i < 4; i++) { getter(); setter(); }"); | 577 "for (var i = 0; i < 4; i++) { getter(); setter(); }"); |
578 CHECK(v8::Utils::OpenHandle(*CompileRun("getter()"))->IsJSGlobalProxy()); | 578 CHECK(v8::Utils::OpenHandle(*CompileRun("getter()"))->IsJSGlobalProxy()); |
579 CHECK(v8::Utils::OpenHandle(*CompileRun("set_value"))->IsJSGlobalProxy()); | 579 CHECK(v8::Utils::OpenHandle(*CompileRun("set_value"))->IsJSGlobalProxy()); |
580 } | 580 } |
| 581 |
| 582 |
| 583 static void EmptyGetter(Local<Name> name, |
| 584 const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 585 ApiTestFuzzer::Fuzz(); |
| 586 } |
| 587 |
| 588 |
| 589 static void OneProperty(Local<String> name, |
| 590 const v8::PropertyCallbackInfo<v8::Value>& info) { |
| 591 ApiTestFuzzer::Fuzz(); |
| 592 info.GetReturnValue().Set(v8_num(1)); |
| 593 } |
| 594 |
| 595 |
| 596 THREADED_TEST(Regress433458) { |
| 597 LocalContext env; |
| 598 v8::Isolate* isolate = env->GetIsolate(); |
| 599 v8::HandleScope scope(isolate); |
| 600 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(isolate); |
| 601 obj->SetHandler(v8::NamedPropertyHandlerConfiguration(EmptyGetter)); |
| 602 obj->SetNativeDataProperty(v8_str("prop"), OneProperty); |
| 603 env->Global()->Set(v8_str("obj"), obj->NewInstance()); |
| 604 CompileRun( |
| 605 "Object.defineProperty(obj, 'prop', { writable: false });" |
| 606 "Object.defineProperty(obj, 'prop', { writable: true });"); |
| 607 } |
OLD | NEW |