Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
[spec] reduce observable calls by inferring global/fullUnicode from t…
Browse files Browse the repository at this point in the history
…he "flags" string
  • Loading branch information
ljharb committed Aug 9, 2018
1 parent 64706b5 commit 888cdf7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
23 changes: 17 additions & 6 deletions index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions spec.emu
Expand Up @@ -52,8 +52,10 @@ contributors: Jordan Harband
1. Let _C_ be ? SpeciesConstructor(_R_, %RegExp%).
1. Let _flags_ be ? ToString(? Get(_R_, `"flags"`)).
1. Let _matcher_ be ? Construct(_C_, « _R_, _flags_ »).
1. Let _global_ be ? ToBoolean(? Get(_matcher_, `"global"`)).
1. Let _fullUnicode_ be ? ToBoolean(? Get(_matcher_, `"unicode"`).
1. If _flags_ contains `"g"`, let _global_ be *true*.
1. Else, let _global_ be *false*.
1. If _flags_ contains `"u"`, let _fullUnicode_ be *true*.
1. Else, let _fullUnicode_ be *false*.
1. Let _lastIndex_ be ? ToLength(? Get(_R_, `"lastIndex"`)).
1. Perform ? Set(_matcher_, `"lastIndex"`, _lastIndex_, *true*).
1. Else,
Expand Down
6 changes: 4 additions & 2 deletions spec.md
Expand Up @@ -30,8 +30,10 @@ The abstract operation *MatchAllIterator* performs the following steps:
1. Let *C* be ? [SpeciesConstructor][species-constructor](*R*, %RegExp%).
1. Let *flags* be ? [ToString][tostring](? [Get][get](*R*, `"flags"`)).
1. Let *matcher* be ? [Construct][construct](*C*, « *R*, *flags* »).
1. Let *global* be ? [ToBoolean][to-boolean](? [Get][get](*matcher*, `"global"`)).
1. Let *fullUnicode* be ? [ToBoolean][to-boolean](? [Get][get](*matcher*, `"unicode"`)).
1. If *flags* contains `"g"`, let *global* be **true**.
1. Else, let *global* be *false*.
1. If *flags* contains `"u"`, let *fullUnicode* be **true**.
1. Else, let *fullUnicode* be **false**.
1. Let *lastIndex* be ? [ToLength][tolength](? [Get][get](*R*, `"lastIndex"`)).
1. Perform ? [Set][set](*matcher*, **"lastIndex"**, *lastIndex*, **true**).
1. Else,
Expand Down

0 comments on commit 888cdf7

Please sign in to comment.