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

Side by Side Diff: src/runtime/runtime-regexp.cc

Issue 2601503002: Add Object::IsNullOrUndefined(Isolate*) helper method (Closed)
Patch Set: fixing merge conflicts Created 3 years, 11 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
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/string-stream.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/runtime/runtime-utils.h" 5 #include "src/runtime/runtime-utils.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/conversions-inl.h" 8 #include "src/conversions-inl.h"
9 #include "src/isolate-inl.h" 9 #include "src/isolate-inl.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 } 1291 }
1292 1292
1293 Handle<JSReceiver> ctor = Handle<JSReceiver>::cast(ctor_obj); 1293 Handle<JSReceiver> ctor = Handle<JSReceiver>::cast(ctor_obj);
1294 1294
1295 Handle<Object> species; 1295 Handle<Object> species;
1296 ASSIGN_RETURN_ON_EXCEPTION( 1296 ASSIGN_RETURN_ON_EXCEPTION(
1297 isolate, species, 1297 isolate, species,
1298 JSObject::GetProperty(ctor, isolate->factory()->species_symbol()), 1298 JSObject::GetProperty(ctor, isolate->factory()->species_symbol()),
1299 Object); 1299 Object);
1300 1300
1301 if (species->IsNull(isolate) || species->IsUndefined(isolate)) { 1301 if (species->IsNullOrUndefined(isolate)) {
1302 return default_ctor; 1302 return default_ctor;
1303 } 1303 }
1304 1304
1305 if (species->IsConstructor()) return species; 1305 if (species->IsConstructor()) return species;
1306 1306
1307 THROW_NEW_ERROR( 1307 THROW_NEW_ERROR(
1308 isolate, NewTypeError(MessageTemplate::kSpeciesNotConstructor), Object); 1308 isolate, NewTypeError(MessageTemplate::kSpeciesNotConstructor), Object);
1309 } 1309 }
1310 1310
1311 MUST_USE_RESULT MaybeHandle<Object> ToUint32(Isolate* isolate, 1311 MUST_USE_RESULT MaybeHandle<Object> ToUint32(Isolate* isolate,
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1678 1678
1679 RUNTIME_FUNCTION(Runtime_IsRegExp) { 1679 RUNTIME_FUNCTION(Runtime_IsRegExp) {
1680 SealHandleScope shs(isolate); 1680 SealHandleScope shs(isolate);
1681 DCHECK_EQ(1, args.length()); 1681 DCHECK_EQ(1, args.length());
1682 CONVERT_ARG_CHECKED(Object, obj, 0); 1682 CONVERT_ARG_CHECKED(Object, obj, 0);
1683 return isolate->heap()->ToBoolean(obj->IsJSRegExp()); 1683 return isolate->heap()->ToBoolean(obj->IsJSRegExp());
1684 } 1684 }
1685 1685
1686 } // namespace internal 1686 } // namespace internal
1687 } // namespace v8 1687 } // namespace v8
OLDNEW
« no previous file with comments | « src/runtime/runtime-object.cc ('k') | src/string-stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698