tc39 / source-map

Source map specification, RFCs and new proposals.

Home Page:https://tc39.es/source-map/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scopes: specify where to place the start and end locations

hbenl opened this issue · comments

For example, when encoding a scope for function f() {}, the start location could be placed at the beginning of function or at {.

Note that Ecma262 defines all this somewhat via bindings and execution order, but not syntactically with tokens (e.g. on which token a scope starts/ends).

We might be able to derive it from the spec, where scopes actually start/end. Or we could look at what JS engines do.

  • in Chrome's debug protocol the start location is reported to be at the opening paren of the function's parameter list (see this comment)
  • Firefox' debug protocol doesn't report locations for scopes