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

Side by Side Diff: src/accessors.cc

Issue 231883007: Return MaybeHandle from Invoke. (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 | « no previous file | src/api.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 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 isolate, result, 217 isolate, result,
218 JSObject::SetLocalPropertyIgnoreAttributes( 218 JSObject::SetLocalPropertyIgnoreAttributes(
219 object, isolate->factory()->length_string(), value, NONE)); 219 object, isolate->factory()->length_string(), value, NONE));
220 return *result; 220 return *result;
221 } 221 }
222 222
223 value = FlattenNumber(isolate, value); 223 value = FlattenNumber(isolate, value);
224 224
225 Handle<JSArray> array_handle = Handle<JSArray>::cast(object); 225 Handle<JSArray> array_handle = Handle<JSArray>::cast(object);
226 226
227 bool has_exception; 227 Handle<Object> uint32_v;
228 Handle<Object> uint32_v = 228 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
229 Execution::ToUint32(isolate, value, &has_exception); 229 isolate, uint32_v, Execution::ToUint32(isolate, value));
230 if (has_exception) return Failure::Exception(); 230 Handle<Object> number_v;
231 Handle<Object> number_v = 231 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
232 Execution::ToNumber(isolate, value, &has_exception); 232 isolate, number_v, Execution::ToNumber(isolate, value));
233 if (has_exception) return Failure::Exception();
234 233
235 if (uint32_v->Number() == number_v->Number()) { 234 if (uint32_v->Number() == number_v->Number()) {
236 Handle<Object> result; 235 Handle<Object> result;
237 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( 236 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(
238 isolate, result, 237 isolate, result,
239 JSArray::SetElementsLength(array_handle, uint32_v)); 238 JSArray::SetElementsLength(array_handle, uint32_v));
240 return *result; 239 return *result;
241 } 240 }
242 return isolate->Throw( 241 return isolate->Throw(
243 *isolate->factory()->NewRangeError("invalid_array_length", 242 *isolate->factory()->NewRangeError("invalid_array_length",
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 info->set_data(Smi::FromInt(index)); 1008 info->set_data(Smi::FromInt(index));
1010 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); 1009 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport);
1011 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); 1010 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport);
1012 info->set_getter(*getter); 1011 info->set_getter(*getter);
1013 if (!(attributes & ReadOnly)) info->set_setter(*setter); 1012 if (!(attributes & ReadOnly)) info->set_setter(*setter);
1014 return info; 1013 return info;
1015 } 1014 }
1016 1015
1017 1016
1018 } } // namespace v8::internal 1017 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698