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

Unified Diff: src/execution.cc

Issue 155453: Firefox and Safari both allow calling regular expression objects as... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
===================================================================
--- src/execution.cc (revision 2427)
+++ src/execution.cc (working copy)
@@ -164,19 +164,16 @@
// If you return a function from here, it will be called when an
// attempt is made to call the given object as a function.
- // The regular expression code here is really meant more as an
- // example than anything else. KJS does not support calling regular
- // expressions as functions, but SpiderMonkey does.
- if (FLAG_call_regexp) {
- bool is_regexp =
- object->IsHeapObject() &&
- (HeapObject::cast(*object)->map()->constructor() ==
- *Top::regexp_function());
+ // Regular expressions can be called as functions in both Firefox
+ // and Safari so we allow it too.
+ bool is_regexp =
+ object->IsHeapObject() &&
+ (HeapObject::cast(*object)->map()->constructor() ==
+ *Top::regexp_function());
- if (is_regexp) {
- Handle<String> exec = Factory::exec_symbol();
- return Handle<Object>(object->GetProperty(*exec));
- }
+ if (is_regexp) {
+ Handle<String> exec = Factory::exec_symbol();
+ return Handle<Object>(object->GetProperty(*exec));
}
// Objects created through the API can have an instance-call handler
« no previous file with comments | « src/arm/stub-cache-arm.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698