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

Unified Diff: src/objects-inl.h

Issue 11896060: Correctly reset lastIndex in an RegExp object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: . Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 3251d9e9b3b3c8817472f9167224e0bcb0d0a5e8..bf9fc95dc50c242e599d52ade3278f30093fecf3 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5009,10 +5009,14 @@ void JSRegExp::SetDataAtUnchecked(int index, Object* value, Heap* heap) {
}
-void JSRegExp::ResetLastIndex() {
- InObjectPropertyAtPut(JSRegExp::kLastIndexFieldIndex,
- Smi::FromInt(0),
- SKIP_WRITE_BARRIER); // It's a Smi.
+void JSRegExp::ResetLastIndex(Isolate* isolate,
+ Handle<JSRegExp> regexp) {
+ // Reset lastIndex property to 0.
+ SetProperty(regexp,
+ isolate->factory()->last_index_symbol(),
+ Handle<Smi>(Smi::FromInt(0)),
+ ::NONE,
Sven Panne 2013/01/23 12:16:12 Do we really need to make the top level namespace
+ kNonStrictMode);
}
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698