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

Side by Side Diff: src/execution.cc

Issue 3613009: Addressing Mads' comments from http://codereview.chromium.org/3585010/show. (Closed)
Patch Set: Created 10 years, 2 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/execution.h ('k') | test/cctest/test-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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 466
467 Handle<Object> Execution::NewDate(double time, bool* exc) { 467 Handle<Object> Execution::NewDate(double time, bool* exc) {
468 Handle<Object> time_obj = Factory::NewNumber(time); 468 Handle<Object> time_obj = Factory::NewNumber(time);
469 RETURN_NATIVE_CALL(create_date, 1, { time_obj.location() }, exc); 469 RETURN_NATIVE_CALL(create_date, 1, { time_obj.location() }, exc);
470 } 470 }
471 471
472 472
473 #undef RETURN_NATIVE_CALL 473 #undef RETURN_NATIVE_CALL
474 474
475 475
476 Handle<JSRegExp> Execution::NewJSRegExp(Handle<String> pattern,
477 Handle<String> flags,
478 bool* exc) {
479 Handle<Object> re_obj = RegExpImpl::CreateRegExpLiteral(
480 Handle<JSFunction>(Top::global_context()->regexp_function()),
481 pattern,
482 flags,
483 exc);
484 if (*exc) return Handle<JSRegExp>();
485 return Handle<JSRegExp>::cast(re_obj);
486 }
487
488
476 Handle<Object> Execution::CharAt(Handle<String> string, uint32_t index) { 489 Handle<Object> Execution::CharAt(Handle<String> string, uint32_t index) {
477 int int_index = static_cast<int>(index); 490 int int_index = static_cast<int>(index);
478 if (int_index < 0 || int_index >= string->length()) { 491 if (int_index < 0 || int_index >= string->length()) {
479 return Factory::undefined_value(); 492 return Factory::undefined_value();
480 } 493 }
481 494
482 Handle<Object> char_at = 495 Handle<Object> char_at =
483 GetProperty(Top::builtins(), Factory::char_at_symbol()); 496 GetProperty(Top::builtins(), Factory::char_at_symbol());
484 if (!char_at->IsJSFunction()) { 497 if (!char_at->IsJSFunction()) {
485 return Factory::undefined_value(); 498 return Factory::undefined_value();
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 return Utils::OpenHandle(*args[0].As<v8::String>())->IsAsciiRepresentation() ? 813 return Utils::OpenHandle(*args[0].As<v8::String>())->IsAsciiRepresentation() ?
801 v8::True() : v8::False(); 814 v8::True() : v8::False();
802 } 815 }
803 816
804 817
805 static ExternalizeStringExtension externalize_extension; 818 static ExternalizeStringExtension externalize_extension;
806 static v8::DeclareExtension externalize_extension_declaration( 819 static v8::DeclareExtension externalize_extension_declaration(
807 &externalize_extension); 820 &externalize_extension);
808 821
809 } } // namespace v8::internal 822 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/execution.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698