Commit 8f770ad9 authored by jgruber's avatar jgruber Committed by Commit bot

[regexp] Mark functions MUST_USE_RESULT

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2442333002
Cr-Commit-Position: refs/heads/master@{#40545}
parent 5a5ffc63
...@@ -39,10 +39,10 @@ Handle<String> PatternFlags(Isolate* isolate, Handle<JSRegExp> regexp) { ...@@ -39,10 +39,10 @@ Handle<String> PatternFlags(Isolate* isolate, Handle<JSRegExp> regexp) {
// ES#sec-regexpinitialize // ES#sec-regexpinitialize
// Runtime Semantics: RegExpInitialize ( obj, pattern, flags ) // Runtime Semantics: RegExpInitialize ( obj, pattern, flags )
MaybeHandle<JSRegExp> RegExpInitialize(Isolate* isolate, MUST_USE_RESULT MaybeHandle<JSRegExp> RegExpInitialize(Isolate* isolate,
Handle<JSRegExp> regexp, Handle<JSRegExp> regexp,
Handle<Object> pattern, Handle<Object> pattern,
Handle<Object> flags) { Handle<Object> flags) {
Handle<String> pattern_string; Handle<String> pattern_string;
if (pattern->IsUndefined(isolate)) { if (pattern->IsUndefined(isolate)) {
pattern_string = isolate->factory()->empty_string(); pattern_string = isolate->factory()->empty_string();
...@@ -1341,9 +1341,9 @@ MaybeHandle<JSArray> RegExpSplit(Isolate* isolate, Handle<JSRegExp> regexp, ...@@ -1341,9 +1341,9 @@ MaybeHandle<JSArray> RegExpSplit(Isolate* isolate, Handle<JSRegExp> regexp,
// ES##sec-speciesconstructor // ES##sec-speciesconstructor
// SpeciesConstructor ( O, defaultConstructor ) // SpeciesConstructor ( O, defaultConstructor )
MaybeHandle<Object> SpeciesConstructor(Isolate* isolate, MUST_USE_RESULT MaybeHandle<Object> SpeciesConstructor(
Handle<JSReceiver> recv, Isolate* isolate, Handle<JSReceiver> recv,
Handle<JSFunction> default_ctor) { Handle<JSFunction> default_ctor) {
Handle<Object> ctor_obj; Handle<Object> ctor_obj;
ASSIGN_RETURN_ON_EXCEPTION( ASSIGN_RETURN_ON_EXCEPTION(
isolate, ctor_obj, isolate, ctor_obj,
......
...@@ -19,16 +19,15 @@ class RegExpUtils : public AllStatic { ...@@ -19,16 +19,15 @@ class RegExpUtils : public AllStatic {
int capture, bool* ok = nullptr); int capture, bool* ok = nullptr);
// Last index (RegExp.lastIndex) accessors. // Last index (RegExp.lastIndex) accessors.
static MaybeHandle<Object> SetLastIndex(Isolate* isolate, static MUST_USE_RESULT MaybeHandle<Object> SetLastIndex(
Handle<JSReceiver> regexp, int value); Isolate* isolate, Handle<JSReceiver> regexp, int value);
static MaybeHandle<Object> GetLastIndex(Isolate* isolate, static MUST_USE_RESULT MaybeHandle<Object> GetLastIndex(
Handle<JSReceiver> recv); Isolate* isolate, Handle<JSReceiver> recv);
// ES#sec-regexpexec Runtime Semantics: RegExpExec ( R, S ) // ES#sec-regexpexec Runtime Semantics: RegExpExec ( R, S )
static MaybeHandle<Object> RegExpExec(Isolate* isolate, static MUST_USE_RESULT MaybeHandle<Object> RegExpExec(
Handle<JSReceiver> regexp, Isolate* isolate, Handle<JSReceiver> regexp, Handle<String> string,
Handle<String> string, Handle<Object> exec);
Handle<Object> exec);
// ES#sec-isregexp IsRegExp ( argument ) // ES#sec-isregexp IsRegExp ( argument )
// Includes checking of the match property. // Includes checking of the match property.
...@@ -42,10 +41,9 @@ class RegExpUtils : public AllStatic { ...@@ -42,10 +41,9 @@ class RegExpUtils : public AllStatic {
// AdvanceStringIndex ( S, index, unicode ) // AdvanceStringIndex ( S, index, unicode )
static int AdvanceStringIndex(Isolate* isolate, Handle<String> string, static int AdvanceStringIndex(Isolate* isolate, Handle<String> string,
int index, bool unicode); int index, bool unicode);
static MaybeHandle<Object> SetAdvancedStringIndex(Isolate* isolate, static MUST_USE_RESULT MaybeHandle<Object> SetAdvancedStringIndex(
Handle<JSReceiver> regexp, Isolate* isolate, Handle<JSReceiver> regexp, Handle<String> string,
Handle<String> string, bool unicode);
bool unicode);
}; };
} // namespace internal } // namespace internal
......
...@@ -1124,7 +1124,7 @@ static Object* SearchRegExpMultiple(Isolate* isolate, Handle<String> subject, ...@@ -1124,7 +1124,7 @@ static Object* SearchRegExpMultiple(Isolate* isolate, Handle<String> subject,
} }
} }
MaybeHandle<String> StringReplaceNonGlobalRegExpWithFunction( MUST_USE_RESULT MaybeHandle<String> StringReplaceNonGlobalRegExpWithFunction(
Isolate* isolate, Handle<String> subject, Handle<JSRegExp> regexp, Isolate* isolate, Handle<String> subject, Handle<JSRegExp> regexp,
Handle<Object> replace_obj) { Handle<Object> replace_obj) {
Factory* factory = isolate->factory(); Factory* factory = isolate->factory();
...@@ -1193,9 +1193,10 @@ MaybeHandle<String> StringReplaceNonGlobalRegExpWithFunction( ...@@ -1193,9 +1193,10 @@ MaybeHandle<String> StringReplaceNonGlobalRegExpWithFunction(
// Legacy implementation of RegExp.prototype[Symbol.replace] which // Legacy implementation of RegExp.prototype[Symbol.replace] which
// doesn't properly call the underlying exec method. // doesn't properly call the underlying exec method.
MaybeHandle<String> RegExpReplace(Isolate* isolate, Handle<JSRegExp> regexp, MUST_USE_RESULT MaybeHandle<String> RegExpReplace(Isolate* isolate,
Handle<String> string, Handle<JSRegExp> regexp,
Handle<Object> replace_obj) { Handle<String> string,
Handle<Object> replace_obj) {
Factory* factory = isolate->factory(); Factory* factory = isolate->factory();
// TODO(jgruber): We need the even stricter guarantee of an unmodified // TODO(jgruber): We need the even stricter guarantee of an unmodified
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment