Skip to content
This repository was archived by the owner on Nov 4, 2023. It is now read-only.

Commit 96bc59d

Browse files
committed
Build the browser version
1 parent ddd9e78 commit 96bc59d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

source-map-resolve.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,17 @@ void (function(root, factory) {
124124
callback = options
125125
options = {}
126126
}
127-
var pending = map.sources.length
127+
var pending = map.sources ? map.sources.length : 0
128128
var result = {
129129
sourcesResolved: [],
130130
sourcesContent: []
131131
}
132132

133+
if (pending === 0) {
134+
callbackAsync(callback, null, result)
135+
return
136+
}
137+
133138
var done = function() {
134139
pending--
135140
if (pending === 0) {
@@ -156,6 +161,11 @@ void (function(root, factory) {
156161
sourcesResolved: [],
157162
sourcesContent: []
158163
}
164+
165+
if (!map.sources || map.sources.length === 0) {
166+
return result
167+
}
168+
159169
resolveSourcesHelper(map, mapUrl, options, function(fullUrl, sourceContent, index) {
160170
result.sourcesResolved[index] = fullUrl
161171
if (read !== null) {
@@ -170,6 +180,7 @@ void (function(root, factory) {
170180
}
171181
}
172182
})
183+
173184
return result
174185
}
175186

0 commit comments

Comments
 (0)