-
Notifications
You must be signed in to change notification settings - Fork 16
/
source-list-map.javascript.txt
34 lines (25 loc) · 2.23 KB
/
source-list-map.javascript.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
SOURCE-LIST-MAP
ALTERNATIVES ==> #See mozilla source-map doc
VERSION ==> #2.0.1
new SourceListMap([...]) #If ..., calls add(...)
SLMAP.add|prepend('COMPILED_CODE',#Append|prepend 'COMPILED_CODE' with:
'SOURCE_PATH', 'SOURCE_CODE') # - beginning of each line in 'SOURCE_CODE' position mapped to beginning of 'COMPILED_CODE'
# - 'SOURCE_PATH' added as SOURCE_MAP "sources"
# - 'SOURCE_CODE' added as SOURCE_MAP "sourceContent"
#Must be called only once per 'SOURCE_PATH'
SLMAP.add|prepend('COMPILED_CODE')#Add 'COMPILED_CODE' with no position mapping
SLMAP.add|prepend(SLMAP2) #
SLMAP.toString()->'COMPILED_CODE' #
SLMAP.toStringWithSourceMap #OBJ:
([OPTS])->OBJ # - source 'COMPILED_CODE'
# - map SOURCE_MAP
#OPTS:
# - file 'COMPILED_FILENAME' (SOURCEMAP "file")
fromStringWithSourceMap
('COMPILED_CODE', SOURCE_MAP)
->SLMAP #Reverse mapping
SLMAP.mapGeneratedNode
(FUNC('COMPILED_CODE')
->'COMPILED_CODE')->SLMAP2 #Apply map FUNC on 'COMPILED_CODE'