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

Side by Side Diff: test/cctest/heap/test-alloc.cc

Issue 2397603003: [runtime] Let native setters have a return value. (Closed)
Patch Set: Ouch. Created 4 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
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/es6/reflect.js » ('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 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 void TestGetter( 110 void TestGetter(
111 v8::Local<v8::Name> name, 111 v8::Local<v8::Name> name,
112 const v8::PropertyCallbackInfo<v8::Value>& info) { 112 const v8::PropertyCallbackInfo<v8::Value>& info) {
113 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate()); 113 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(info.GetIsolate());
114 HandleScope scope(isolate); 114 HandleScope scope(isolate);
115 info.GetReturnValue().Set(v8::Utils::ToLocal( 115 info.GetReturnValue().Set(v8::Utils::ToLocal(
116 v8::internal::HeapTester::TestAllocateAfterFailures())); 116 v8::internal::HeapTester::TestAllocateAfterFailures()));
117 } 117 }
118 118
119 119 void TestSetter(v8::Local<v8::Name> name, v8::Local<v8::Value> value,
120 void TestSetter( 120 const v8::PropertyCallbackInfo<v8::Boolean>& info) {
121 v8::Local<v8::Name> name,
122 v8::Local<v8::Value> value,
123 const v8::PropertyCallbackInfo<void>& info) {
124 UNREACHABLE(); 121 UNREACHABLE();
125 } 122 }
126 123
127 124
128 Handle<AccessorInfo> TestAccessorInfo( 125 Handle<AccessorInfo> TestAccessorInfo(
129 Isolate* isolate, PropertyAttributes attributes) { 126 Isolate* isolate, PropertyAttributes attributes) {
130 Handle<String> name = isolate->factory()->NewStringFromStaticChars("get"); 127 Handle<String> name = isolate->factory()->NewStringFromStaticChars("get");
131 return Accessors::MakeAccessor(isolate, name, &TestGetter, &TestSetter, 128 return Accessors::MakeAccessor(isolate, name, &TestGetter, &TestSetter,
132 attributes); 129 attributes);
133 } 130 }
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 code_range.FreeRawMemory(blocks[index].base, blocks[index].size); 239 code_range.FreeRawMemory(blocks[index].base, blocks[index].size);
243 current_allocated -= blocks[index].size; 240 current_allocated -= blocks[index].size;
244 if (index < blocks.length() - 1) { 241 if (index < blocks.length() - 1) {
245 blocks[index] = blocks.RemoveLast(); 242 blocks[index] = blocks.RemoveLast();
246 } else { 243 } else {
247 blocks.RemoveLast(); 244 blocks.RemoveLast();
248 } 245 }
249 } 246 }
250 } 247 }
251 } 248 }
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/es6/reflect.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698