Skip to content

Commit

Permalink
Remove sections.url (tc39#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaro-sevcik authored Jul 6, 2023
1 parent 7f46b15 commit c3d2c3b
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions source-map.bs
Original file line number Diff line number Diff line change
Expand Up @@ -268,44 +268,48 @@ alternate representation of a map is supported:
"version" : 3,
"file": "app.js",
"sections": [
{"offset": {"line": 0, "column": 0}, "url": "url_for_part1.map"}
{
"offset": {"line": 100, "column": 10},
"offset": {"line": 0, "column": 0},
"map": {
"version" : 3,
"file": "section.js",
"sources": ["foo.js", "bar.js"],
"names": ["src", "maps", "are", "fun"],
"mappings": "AAAA,E;;ABCDE;"
}
},
{
"offset": {"line": 100, "column": 10},
"map": {
"version" : 3,
"file": "another_section.js",
"sources": ["more.js"],
"names": ["more", "is", "better"],
"mappings": "AAAA,E;AACA,C;ABCDE;"
}
}
],
]
}
```

The index map follow the form of the standard map. Like the regular source map
The index map follows the form of the standard map. Like the regular source map
the file format is JSON with a top-level object. It shares the [=version=] and
[=file=] field from the regular source map, but gains a new [=sections=] field.

<dfn><code>sections</code></dfn> is an array of JSON objects that itself has two
fields [=offset=] and a source map reference.
fields [=offset=] and [=map=].

## Section

<dfn><code>offset</dfn></code> is an object with two fields, `line` and `column`,
that represent the offset into generated code that the referenced source map
represents.

<dfn><code>url</code></dfn> is an entry that must be a [[URL]] where a source
map can be found for this section and the [=url=] is resolved in the same way as
the [=sources=] fields in the standard map.

<dfn><code>map</code></dfn> is an alternative entry to [=url=] that must be an
embedded complete source map object. An embedded map does not inherit any
values from the containing index map.
<dfn><code>map</code></dfn> is an embedded complete source map object.
An embedded map does not inherit any values from the containing index map.

The sections must be sorted by starting position and the represented sections
may not overlap and each section must either use [=map=] or [=url=] but not mboth.
may not overlap.

Conventions {#conventions}
==========================
Expand Down

0 comments on commit c3d2c3b

Please sign in to comment.