map from, so just use "?". and in any case, don't fail hard when addMapping throws.
};
var add_mapping = options.source_map ? function(token, name) {
- options.source_map.add(
- token.file,
- current_line, current_col,
- token.line, token.col,
- (!name && token.type == "name") ? token.value : name
- );
+ try {
+ if (token) options.source_map.add(
+ token.file || "?",
+ current_line, current_col,
+ token.line, token.col,
+ (!name && token.type == "name") ? token.value : name
+ );
+ } catch(ex) {
+ AST_Node.warn("Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]", {
+ file: token.file,
+ line: token.line,
+ col: token.col,
+ cline: current_line,
+ ccol: current_col,
+ name: name || ""
+ })
+ }
} : noop;
function get() {