* @deprecated May be removed in the next major version
JavaScriptCompiler.isValidJavaScriptVariableName = function (name) {
return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
function strictLookup(requireTerminal, compiler, parts, type) {
var stack = compiler.popStack(),
stack = compiler.nameLookup(stack, parts[i], type);
return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ', ', JSON.stringify(compiler.source.currentLocation), ' )'];
exports['default'] = JavaScriptCompiler;
module.exports = exports['default'];
/***/ (function(module, exports, __webpack_require__) {
var _Object$keys = __webpack_require__(13)['default'];
exports.__esModule = true;
var _utils = __webpack_require__(5);
var SourceNode = undefined;
/* istanbul ignore next */
// 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;
/* istanbul ignore if: tested but not covered in istanbul due to dist build */
SourceNode = function (line, column, srcFile, chunks) {
/* istanbul ignore next */
add: function add(chunks) {
if (_utils.isArray(chunks)) {
chunks = chunks.join('');
prepend: function prepend(chunks) {
if (_utils.isArray(chunks)) {
chunks = chunks.join('');
this.src = chunks + this.src;
toStringWithSourceMap: function toStringWithSourceMap() {
return { code: this.toString() };
toString: function toString() {
function castChunk(chunk, codeGen, loc) {
if (_utils.isArray(chunk)) {
for (var i = 0, len = chunk.length; i < len; i++) {
ret.push(codeGen.wrap(chunk[i], loc));
} else if (typeof chunk === 'boolean' || typeof chunk === 'number') {
// Handle primitives that the SourceNode will throw up on
function CodeGen(srcFile) {
isEmpty: function isEmpty() {
return !this.source.length;
prepend: function prepend(source, loc) {
this.source.unshift(this.wrap(source, loc));
push: function push(source, loc) {
this.source.push(this.wrap(source, loc));
merge: function merge() {
var source = this.empty();
this.each(function (line) {
source.add([' ', line, '\n']);
each: function each(iter) {
for (var i = 0, len = this.source.length; i < len; i++) {
empty: function empty() {
var loc = this.currentLocation || { start: {} };
return new SourceNode(loc.start.line, loc.start.column, this.srcFile);
wrap: function wrap(chunk) {
var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1];
if (chunk instanceof SourceNode) {
chunk = castChunk(chunk, this, loc);
return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk);
functionCall: function functionCall(fn, type, params) {
params = this.generateList(params);
return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']);
quotedString: function quotedString(str) {
return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4
.replace(/\u2029/g, '\\u2029') + '"';
objectLiteral: function objectLiteral(obj) {
_Object$keys(obj).forEach(function (key) {
var value = castChunk(obj[key], _this);
if (value !== 'undefined') {
pairs.push([_this.quotedString(key), ':', value]);
var ret = this.generateList(pairs);
generateList: function generateList(entries) {
for (var i = 0, len = entries.length; i < len; i++) {
ret.add(castChunk(entries[i], this));
generateArray: function generateArray(entries) {
var ret = this.generateList(entries);
exports['default'] = CodeGen;
module.exports = exports['default'];