{"action":"opened","issue":{"url":"https://api.github.com/repos/tc39/ecma262/issues/477","repository_url":"https://api.github.com/repos/tc39/ecma262","labels_url":"https://api.github.com/repos/tc39/ecma262/issues/477/labels{/name}","comments_url":"https://api.github.com/repos/tc39/ecma262/issues/477/comments","events_url":"https://api.github.com/repos/tc39/ecma262/issues/477/events","html_url":"https://github.com/tc39/ecma262/issues/477","id":141111549,"number":477,"title":"Question: Intended semantics for setting lastIndex?","user":{"login":"littledan","id":189835,"avatar_url":"https://avatars.githubusercontent.com/u/189835?v=3","gravatar_id":"","url":"https://api.github.com/users/littledan","html_url":"https://github.com/littledan","followers_url":"https://api.github.com/users/littledan/followers","following_url":"https://api.github.com/users/littledan/following{/other_user}","gists_url":"https://api.github.com/users/littledan/gists{/gist_id}","starred_url":"https://api.github.com/users/littledan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/littledan/subscriptions","organizations_url":"https://api.github.com/users/littledan/orgs","repos_url":"https://api.github.com/users/littledan/repos","events_url":"https://api.github.com/users/littledan/events{/privacy}","received_events_url":"https://api.github.com/users/littledan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-15T21:58:44Z","updated_at":"2016-03-15T21:58:44Z","closed_at":null,"body":"In https://tc39.github.io/ecma262/#sec-regexpbuiltinexec step 12.a.iii, `lastIndex` is set to 0 regardless of whether _sticky_ or _global_ is true. However, in all other cases, `lastIndex` is only set when those flags are present. These semantics were a little surprising to me--were they intentional? I'm curious about the history. This came up for me in code review for implementing part of ES2017 semantics for RegExps https://codereview.chromium.org/1776883005 @allenwb @hashseed"}}