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

Unified Diff: src/objects.cc

Issue 2109593002: [regexp] Fix writing of lastIndex in JSRegExp::Initialize. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | « no previous file | test/mjsunit/regress/regress-349870.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index ddf62b153cb6e98dbb8291b9184a1ebe35c975e8..6ab360485979f7cba4335977eb88b4425aa169c0 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -16041,12 +16041,11 @@ MaybeHandle<JSRegExp> JSRegExp::Initialize(Handle<JSRegExp> regexp,
Smi::FromInt(0), SKIP_WRITE_BARRIER);
} else {
// Map has changed, so use generic, but slower, method.
- PropertyAttributes writable =
- static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
- JSObject::SetOwnPropertyIgnoreAttributes(
- regexp, factory->last_index_string(),
- Handle<Smi>(Smi::FromInt(0), isolate), writable)
- .Check();
+ RETURN_ON_EXCEPTION(
+ isolate,
+ JSReceiver::SetProperty(regexp, factory->last_index_string(),
+ Handle<Smi>(Smi::FromInt(0), isolate), STRICT),
+ JSRegExp);
}
return regexp;
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-349870.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698