@@ -1,9 +1,19 @@
|
|||||||
import {isArray} from "../utils";
|
import {isArray} from "../utils";
|
||||||
|
|
||||||
|
var SourceNode;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var SourceMap = require('source-map'),
|
if (typeof define !== 'function' || !define.amd) {
|
||||||
SourceNode = SourceMap.SourceNode;
|
// We don't support this in AMD environments. For these environments, we asusme that
|
||||||
|
// they are running on the browser and thus have no need for the source-map library.
|
||||||
|
var SourceMap = require('source-map');
|
||||||
|
SourceNode = SourceMap.SourceNode;
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
/* NOP */
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!SourceNode) {
|
||||||
/* istanbul ignore next: tested but not covered in istanbul due to dist build */
|
/* istanbul ignore next: tested but not covered in istanbul due to dist build */
|
||||||
SourceNode = function(line, column, srcFile, chunks) {
|
SourceNode = function(line, column, srcFile, chunks) {
|
||||||
this.src = '';
|
this.src = '';
|
||||||
|
|||||||
+4
-2
@@ -1,7 +1,9 @@
|
|||||||
/*global CompilerContext, Handlebars */
|
/*global CompilerContext, Handlebars */
|
||||||
try {
|
try {
|
||||||
var SourceMap = require('source-map'),
|
if (typeof define !== 'function' || !define.amd) {
|
||||||
SourceMapConsumer = SourceMap.SourceMapConsumer;
|
var SourceMap = require('source-map'),
|
||||||
|
SourceMapConsumer = SourceMap.SourceMapConsumer;
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
/* NOP for in browser */
|
/* NOP for in browser */
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user