r.js revision fb27c098f332a202cf0d952b5d6b14753f72d1fe
0N/A * see: http://github.com/jrburke/requirejs for details
0N/A useLibLoaded = {},
0N/A //Temporarily hide require and define to allow require.js to define
* see: http://github.com/jrburke/requirejs for details
(function (global) {
var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
return (config.config && config.config[mod.map.id]) || {};
if (!mod.inited) {
if (!depMod.inited || !depMod.enabled) {
if (!mod.inited || !mod.map.isDefine) {
if (!depMod.inited || !depMod.enabled) {
if (!mod.inited && expired) {
} else if (!mod.inited && mod.fetched && map.isDefine) {
if (this.inited) {
this.inited = true;
if (!this.inited) {
this.init([], function () { return value; }, null, {
this.init([], function () { return value; }, null, {
this.inited = true;
//issue, see attachEvent/addEventListener comment elsewhere
//existing ones in context.config.
//config object before require.js is loaded.
return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
requireMod.init(deps, callback, errback, {
mod && !mod.inited) {
if (req.jsExtRegExp.test(moduleName)) {
//Add extension if it is included. This is a bit wonky, only non-.js things pass
* name for minification/local scope use.
context.configure(config);
* Support require.config() to make it easier to cooperate with other
req.config = function (config) {
req.jsExtRegExp = /^\/|:|\?|\.js$/;
var config = (context && context.config) || {},
document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
node.type = config.scriptType || 'text/javascript';
//https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
//Figure out baseUrl. Get it from the script tag with require.js in it.
* see: http://github.com/jrburke/requirejs for details
* see: http://github.com/jrburke/requirejs for details
* This adapter assumes that x.js has loaded it and set up
* node adapater is r.js.
return (context.config.nodeRequire || req.nodeRequire)(moduleName);
//like Joyent where it defaults to a server.js as the only executed
fileName = 'main.js';
* see: http://github.com/jrburke/requirejs for details
* see: http://github.com/jrburke/requirejs for details
//Needed so that rhino/assert can return a stub for uglify's consolidator.js
* see: http://github.com/jrburke/requirejs for details
//Just a stub for use with uglify's consolidator.js
* see: http://github.com/jrburke/requirejs for details
//Ignore any command option used for rq.js
* see: http://github.com/jrburke/requirejs for details
var jsLibRhinoArgs = (typeof rhinoArgs !== 'undefined' && rhinoArgs) || [].concat(Array.prototype.slice.call(arguments, 0));
//Ignore any command option used for rq.js
* see: http://github.com/jrburke/requirejs for details
* see: http://github.com/jrburke/requirejs for details
* see: http://github.com/jrburke/requirejs for details
getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths) {
//Ignores files/directories that start with a period (.) unless exclusionRegExp
copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) {
if (file.exists(destFileName) && fs.statSync(destFileName).mtime.getTime() >= fs.statSync(srcFileName).mtime.getTime()) {
* see: http://github.com/jrburke/requirejs for details
getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths, /*boolean?*/startDirIsJavaObject) {
//Ignores files/directories that start with a period (.) unless exclusionRegExp
copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) {
input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(fileObj), encoding)),
// Note that when we use utf-8, the BOM should appear as "EF BB BF", but it doesn't due to this bug in the JDK:
* see: http://github.com/jrburke/requirejs for details
* see: http://github.com/jrburke/requirejs for details
* see: http://github.com/jrburke/requirejs for details
* see: http://github.com/jrburke/requirejs for details
(function (exports) {
var Token,
Token = {
TokenName = {};
Syntax = {
PropertyKind = {
Messages = {
StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
// See also tools/generate-unicode-regex.py.
Regex = {
NonAsciiIdentifierStart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]'),
NonAsciiIdentifierPart: new RegExp('[\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0300-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u0483-\u0487\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u05d0-\u05ea\u05f0-\u05f2\u0610-\u061a\u0620-\u0669\u066e-\u06d3\u06d5-\u06dc\u06df-\u06e8\u06ea-\u06fc\u06ff\u0710-\u074a\u074d-\u07b1\u07c0-\u07f5\u07fa\u0800-\u082d\u0840-\u085b\u08a0\u08a2-\u08ac\u08e4-\u08fe\u0900-\u0963\u0966-\u096f\u0971-\u0977\u0979-\u097f\u0981-\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bc-\u09c4\u09c7\u09c8\u09cb-\u09ce\u09d7\u09dc\u09dd\u09df-\u09e3\u09e6-\u09f1\u0a01-\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a59-\u0a5c\u0a5e\u0a66-\u0a75\u0a81-\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abc-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ad0\u0ae0-\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3c-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b5c\u0b5d\u0b5f-\u0b63\u0b66-\u0b6f\u0b71\u0b82\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd0\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c58\u0c59\u0c60-\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbc-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0cde\u0ce0-\u0ce3\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d44\u0d46-\u0d48\u0d4a-\u0d4e\u0d57\u0d60-\u0d63\u0d66-\u0d6f\u0d7a-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e01-\u0e3a\u0e40-\u0e4e\u0e50-\u0e59\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb9\u0ebb-\u0ebd\u0ec0-\u0ec4\u0ec6\u0ec8-\u0ecd\u0ed0-\u0ed9\u0edc-\u0edf\u0f00\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e-\u0f47\u0f49-\u0f6c\u0f71-\u0f84\u0f86-\u0f97\u0f99-\u0fbc\u0fc6\u1000-\u1049\u1050-\u109d\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u135d-\u135f\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176c\u176e-\u1770\u1772\u1773\u1780-\u17d3\u17d7\u17dc\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u1820-\u1877\u1880-\u18aa\u18b0-\u18f5\u1900-\u191c\u1920-\u192b\u1930-\u193b\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19d9\u1a00-\u1a1b\u1a20-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1aa7\u1b00-\u1b4b\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1bf3\u1c00-\u1c37\u1c40-\u1c49\u1c4d-\u1c7d\u1cd0-\u1cd2\u1cd4-\u1cf6\u1d00-\u1de6\u1dfc-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200c\u200d\u203f\u2040\u2054\u2071\u207f\u2090-\u209c\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d7f-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2de0-\u2dff\u2e2f\u3005-\u3007\u3021-\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u3099\u309a\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua62b\ua640-\ua66f\ua674-\ua67d\ua67f-\ua697\ua69f-\ua6f1\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua827\ua840-\ua873\ua880-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f7\ua8fb\ua900-\ua92d\ua930-\ua953\ua960-\ua97c\ua980-\ua9c0\ua9cf-\ua9d9\uaa00-\uaa36\uaa40-\uaa4d\uaa50-\uaa59\uaa60-\uaa76\uaa7a\uaa7b\uaa80-\uaac2\uaadb-\uaadd\uaae0-\uaaef\uaaf2-\uaaf6\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabea\uabec\uabed\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\ufe70-\ufe74\ufe76-\ufefc\uff10-\uff19\uff21-\uff3a\uff3f\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]')
if (!condition) {
'\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\uFEFF'.indexOf(ch) >= 0);
switch (id) {
switch (id) {
var keyword = false;
keyword = (id === 'this') || (id === 'else') || (id === 'case') || (id === 'void') || (id === 'with');
if (keyword) {
switch (id) {
function nextChar() {
function skipComment() {
blockComment = false;
lineComment = false;
if (lineComment) {
lineComment = false;
++index;
++lineNumber;
} else if (blockComment) {
++index;
++lineNumber;
++index;
++index;
blockComment = false;
lineComment = true;
blockComment = true;
++index;
++index;
++index;
++lineNumber;
function scanIdentifier() {
++index;
++index;
if (ch) {
++index;
++index;
if (ch) {
function scanPunctuator() {
ch2,
ch3,
ch4;
++index;
++index;
function scanNumericLiteral() {
octal: true,
function scanStringLiteral() {
++index;
switch (ch) {
if (unescaped) {
octal = true;
octal = true;
++lineNumber;
++index;
function scanRegExp() {
buffer = null;
skipComment();
if (classMarker) {
classMarker = false;
classMarker = true;
++index;
++index;
if (ch) {
function advance() {
skipComment();
return token;
return scanStringLiteral();
return scanNumericLiteral();
return token;
function lex() {
var token;
if (buffer) {
buffer = null;
return token;
buffer = null;
return advance();
function lookahead() {
if (buffer !== null) {
return buffer;
return buffer;
function peekLineTerminator() {
skipComment();
return found;
var error,
throw error;
function throwErrorTolerant() {
var error;
function matchAssign() {
function consumeSemicolon() {
lex();
skipComment();
lex();
function parseArrayInitialiser() {
var elements = [],
lex();
id: null,
function parseObjectPropertyKey() {
function parseObjectProperty() {
function parseObjectInitialiser() {
kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;
function parsePrimaryExpression() {
var expr,
lex();
return parseFunctionExpression();
lex();
lex();
return parseArrayInitialiser();
return parseObjectInitialiser();
lex();
return expr;
function parseArguments() {
var args = [];
return args;
function parseNonComputedProperty() {
computed: false,
expr = {
computed: true,
return expr;
function parseNewExpression() {
var expr;
expr = {
return expr;
function parseLeftHandSideExpressionAllowCall() {
lex();
return expr;
function parseLeftHandSideExpression() {
lex();
return expr;
function parsePostfixExpression() {
expr = {
prefix: false
return expr;
function parseUnaryExpression() {
expr = {
prefix: true
return expr;
expr = {
return expr;
expr = {
return expr;
return parsePostfixExpression();
function parseMultiplicativeExpression() {
expr = {
return expr;
function parseAdditiveExpression() {
expr = {
return expr;
function parseShiftExpression() {
expr = {
return expr;
function parseRelationalExpression() {
expr = {
lex();
expr = {
lex();
expr = {
return expr;
function parseEqualityExpression() {
expr = {
return expr;
function parseBitwiseANDExpression() {
lex();
expr = {
return expr;
function parseBitwiseORExpression() {
lex();
expr = {
return expr;
function parseBitwiseXORExpression() {
lex();
expr = {
return expr;
function parseLogicalANDExpression() {
lex();
expr = {
return expr;
function parseLogicalORExpression() {
lex();
expr = {
return expr;
function parseConditionalExpression() {
lex();
expr = {
return expr;
function parseAssignmentExpression() {
var expr;
if (matchAssign()) {
expr = {
return expr;
function parseExpression() {
expr = {
lex();
return expr;
function parseStatementList() {
var list = [],
return list;
function parseBlock() {
var block;
function parseVariableIdentifier() {
init = null;
lex();
var list = [];
lex();
return list;
function parseVariableStatement() {
var declarations;
var declarations;
function parseEmptyStatement() {
function parseExpressionStatement() {
function parseIfStatement() {
lex();
alternate = null;
function parseDoWhileStatement() {
lex();
function parseWhileStatement() {
function parseForVariableDeclaration() {
function parseForStatement() {
lex();
lex();
init = null;
lex();
init = null;
each: false
function parseContinueStatement() {
lex();
label: null
if (peekLineTerminator()) {
label: null
function parseBreakStatement() {
lex();
label: null
if (peekLineTerminator()) {
label: null
function parseReturnStatement() {
if (peekLineTerminator()) {
argument: null
function parseWithStatement() {
if (strict) {
function parseSwitchCase() {
var test,
consequent = [],
lex();
test = null;
function parseSwitchStatement() {
lex();
cases = [];
function parseThrowStatement() {
var argument;
if (peekLineTerminator()) {
function parseCatchClause() {
var param;
guard: null,
function parseTryStatement() {
lex();
function parseDebuggerStatement() {
function parseStatement() {
expr,
return parseEmptyStatement();
return parseBlock();
return parseExpressionStatement();
return parseBreakStatement();
return parseContinueStatement();
return parseDebuggerStatement();
return parseDoWhileStatement();
return parseForStatement();
return parseFunctionDeclaration();
return parseIfStatement();
return parseReturnStatement();
return parseSwitchStatement();
return parseThrowStatement();
return parseTryStatement();
return parseVariableStatement();
return parseWhileStatement();
return parseWithStatement();
lex();
function parseFunctionSourceElements() {
strict = true;
if (firstRestricted) {
function parseFunctionDeclaration() {
if (strict) {
paramSet = {};
if (strict) {
} else if (!firstRestricted) {
function parseFunctionExpression() {
if (strict) {
paramSet = {};
if (strict) {
} else if (!firstRestricted) {
function parseSourceElement() {
return parseFunctionDeclaration();
return parseStatement();
return parseStatement();
function parseSourceElements() {
strict = true;
if (firstRestricted) {
return sourceElements;
function parseProgram() {
var program;
strict = false;
program = {
return program;
function scanComment() {
blockComment = false;
lineComment = false;
if (lineComment) {
lineComment = false;
lineComment = false;
++index;
++lineNumber;
} else if (blockComment) {
++index;
++lineNumber;
++index;
blockComment = false;
++index;
lineComment = true;
blockComment = true;
++index;
++index;
++index;
++lineNumber;
function collectToken() {
return token;
function collectRegex() {
skipComment();
return regex;
return function (parseFunction) {
skipComment();
locInfo = {
start: {
if (range) {
if (loc) {
return node;
function patch() {
var wrapTracking;
function unpatch() {
result = [],
return result;
toString = String;
buffer = null;
state = {
allowIn: true,
labelSet: {},
lastParenthesized: null,
inFunctionBody: false,
inIteration: false,
inSwitch: false
extra = {};
if (code instanceof String) {
patch();
unpatch();
extra = {};
return program;
// Sync with package.json.
return types;
define('uglifyjs/consolidator', ["require", "exports", "module", "./parse-js", "./process"], function(require, exports, module) {
* @preserve Copyright 2012 Robert Gust-Bardon <http://robert.gust-bardon.org/>.
* @fileoverview Enhances <a href="https://github.com/mishoo/UglifyJS/"
* "http://closure-compiler.googlecode.com/">the Closure Compiler</a> since its
* href="http://tools.ietf.org/html/rfc2616#section-3.5">encoding
* "http://code.jquery.com/jquery-1.7.1.js">jQuery 1.7.1</a> takes 248235 bytes.
* Building it with <a href="https://github.com/mishoo/UglifyJS/tarball/v1.2.5">
* "http://linux.die.net/man/1/gzip">gzip(1)</a>. Building it with the same
* <p>Written in <a href="http://es5.github.com/#x4.2.2">the strict variant</a>
* of <a href="http://es5.github.com/">ECMA-262 5.1 Edition</a>. Encoded in <a
* href="http://tools.ietf.org/html/rfc3629">UTF-8</a>. Follows <a href=
* <li><a href="http://nodejs.org/dist/v0.6.10/">Node v0.6.10</a>,</li>
* <li><a href="https://github.com/mishoo/UglifyJS/tarball/v1.2.5">UglifyJS
TSourceElementsData = function() {
this.aCount = [];
this.aIdentifiers = [];
this.aPrimitiveValues = [];
TPrimitiveValue = function() {
TSolution = function() {
this.oPrimitiveValues = {};
oWeights = {
EValuePrefixes = {
* "http://es5.github.com/#x12.10">{@code with}</a> statement.
* "http://es5.github.com/#x15.1.2.1">{@code eval}</a> identifier name.
oWalkers = {
fExamineSyntacticCodeUnit(this);
fExamineSyntacticCodeUnit(this);
aSourceElementsData = [],
* immediately following a <a href="http://es5.github.com/#x14.1"
nTo,
var fLambda = function() {
return fLambda;
fClassifyAsExcludable = function() {
sPrefixed) &&
var sPrefixed =
sPrefixed) &&
aVariableDeclarations = [],
return fLambda;
sPrefixed)) {
return fLambda;
Object.keys(
return fLambda;
var nDifference =
sName =
new TPrimitiveValue();
][sPrefixed] *
][sPrefixed] *
if (bEnclose) {
if (bEnclose) {
if (bEnclose) {
return oAbstractSyntaxTree;
This version is suitable for Node.js. With minimal changes (the
Based on parse-js (http://marijn.haverbeke.nl/parse-js/).
var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i;
var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\u000b\u200b\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000"));
letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),
combining_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u08FE\\u0900-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C82\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D02\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1DC0-\\u1DE6\\u1DFC-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"),
connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]"),
digit: new RegExp("[\\u0030-\\u0039\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19]")
return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack;
var EX_EOF = {};
newline_before : false,
regex_allowed : false,
comments_before : []
throw EX_EOF;
++S.line;
++S.col;
return ch;
function eof() {
return !S.peek();
return pos;
function start_token() {
var ret = {
if (!is_comment) {
S.comments_before = [];
S.newline_before = false;
return ret;
function skip_whitespace() {
next();
return ret;
if (has_x) return false;
return has_x = true;
if (has_e) return false;
after_e = false;
return has_dot = true;
if (prefix)
switch (ch) {
default : return ch;
function hex_bytes(n) {
return num;
function read_string() {
if (!first) {
return ++octal_len;
function read_line_comment() {
next();
S.pos = i;
function read_multiline_comment() {
next();
// https://github.com/mishoo/UglifyJS/issues/#issue/100
warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer.");
function read_name() {
if (!backslash) {
if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier");
backslash = false;
return name;
prev_backslash = false;
in_class = true;
in_class = false;
prev_backslash = true;
next();
return op;
function handle_slash() {
next();
switch (peek()) {
return next_token();
return next_token();
function handle_dot() {
next();
function read_word() {
return cont();
} catch(ex) {
else throw ex;
if (force_regexp != null)
start_token();
return next_token;
while (i < a.length) {
return ret;
ret[b[j]] = n;
return ret;
token : null,
prev : null,
peeked : null,
in_directives : true,
labels : []
function next() {
if (S.peeked) {
S.peeked = null;
return S.token;
function prev() {
return S.prev;
if (token == null)
return next();
function can_insert_semicolon() {
return !exigent_mode && (
function semicolon() {
function as() {
function parenthesised() {
return ex;
if (embed_tokens) return function() {
return ast;
else return parser;
S.peeked = null;
return stat;
return simple_statement();
: simple_statement();
return simple_statement();
next();
unexpected();
semicolon();
return (function(body){
return for_();
return function_(true);
return if_();
? (next(), null)
return try_();
unexpected();
function simple_statement() {
var name;
if (!can_insert_semicolon()) {
if (name != null) {
next();
semicolon();
function for_() {
var init = null;
: expression(true, true);
next();
unexpected();
name,
(function(first, a){
next();
next();
++S.in_function;
S.in_directives = true;
var a = block_();
--S.in_function;
function if_() {
next();
function block_() {
next();
var a = [], cur = null;
next();
cur = [];
next();
cur = [];
next();
function try_() {
next();
next();
next();
unexpected();
next();
next();
next();
function const_() {
function new_() {
next();
args = [];
next();
return new_();
next();
next();
next();
unexpected();
next();
unexpected();
var first = true, a = [];
next();
function array_() {
function object_() {
var first = true, a = [];
next();
function as_property_name() {
return as_name();
function as_name() {
unexpected();
next();
next();
next();
return expr;
next();
return val;
next();
return left;
next();
return expr;
if (!exigent_mode) return true;
next();
return left;
commas = true;
next();
return expr;
++S.in_loop;
return cont();
--S.in_loop;
function curry(f) {
if (ret instanceof Function)
arguments[i]();
return ret;
function array_to_hash(a) {
var ret = {};
ret[a[i]] = true;
return ret;
var warn = function() {};
define('uglifyjs/squeeze-more', ["require", "exports", "module", "./parse-js", "./process"], function(require, exports, module) {
scope = s;
return ret;
return w.with_walkers({
} else if ((ctor[1] == "RegExp" || ctor[1] == "Function" || ctor[1] == "Error") && !scope.has(ctor[1])) {
define('uglifyjs/process', ["require", "exports", "module", "./parse-js", "./squeeze-more"], function(require, exports, module) {
This version is suitable for Node.js. With minimal changes (the
function ast_walker() {
if (statements != null)
return out;
var walkers = {
var user = {};
var stack = [];
if (ast == null)
if (gen) {
if (ret != null)
return ret;
if (ast == null)
var save = {}, i;
return ret;
parent: function() {
stack: function() {
return stack;
if (parent) {
function base54_digits() {
return DIGITS_OVERRIDE_FOR_TESTING;
var base54 = (function(){
return function(num) {
return ret;
for (var s = this; s; s = s.parent)
for (var s = this; s; s = s.parent)
toJSON: function() {
next_mangled: function() {
if (!is_identifier(m))
if (name != null) {
return name;
var current_scope = null;
var having_eval = [];
return ret;
return function(defs) {
if (label)
return with_new_scope(function(){
s.uses_with = true;
if (s === origin) break;
return ret;
mangle : true,
toplevel : false,
defines : null,
except : null,
no_functions : false
return name;
return name;
if (name) {
extra = {};
else name = null;
}, extra);
scope = s;
get_mangled(i, true);
return ret;
return w.with_walkers({
return ast;
var self = this;
var warn = function(){};
function last_stat(b) {
function aborts(t) {
function empty(b) {
var when_constant = (function(){
var $NOT_CONSTANT = {};
throw $NOT_CONSTANT;
switch (typeof val) {
} catch(ex) {
expr);
} catch(ex2) {
else throw ex;
if (!aborts(t)) continue;
return statements;
return w.with_walkers({
redo_if(t),
f != null ? redo_if(f) : null
return w.with_walkers({
} catch(ex) {
throw ex;
return [ name ];
stop();
stop();
restart();
stop();
return body;
var ret = null;
var d = defs[i];
if (ret == null) {
return w.with_walkers({
make_seqs : true,
dead_code : true,
no_warnings : false,
keep_comps : true,
unsafe : false
function negate(c) {
c = slice(c);
switch (op) {
return not_c;
function make_conditional(c, t, e) {
var make_real_conditional = function() {
return e ? best_of(
return (val ? t : e);
return block;
scope = s;
return ret;
// 5. if block_type == "lambda" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... }
if (has_quit) {
has_quit = true;
// a.push(make_if(stat[1], [ "block", stat[2][1].slice(0, -1) ], [ "block", statements.slice(i) ]));
return statements;
function make_if(c, t, e) {
if (val) {
t = walk(t);
warn_unreachable(e);
e = walk(e);
warn_unreachable(t);
return make_real_if(c, t, e);
function abort_else(c, t, e) {
function make_real_if(c, t, e) {
c = walk(c);
t = walk(t);
e = walk(e);
if (empty(t)) {
c = negate(c);
} else if (empty(e)) {
var a = gen_code(c);
var n = negate(c);
var b = gen_code(n);
var tmp = t;
e = tmp;
else if (aborts(e))
else if (e && aborts(t)) {
else if (t && aborts(e)) {
return ret;
if (!val) {
return w.with_walkers({
}, function no() {
tighten(t),
f != null ? tighten(f) : null
}, function() { return ret });
switch (name) {
return ast;
quote_keys : false,
space_colon : false,
beautify : false,
ascii_only : false,
inline_script: false
return ret;
return name;
if (line == null)
if (beautify)
return line;
function add_spaces(a) {
if (beautify)
b.push(a[i]);
if (next &&
function add_commas(a) {
return gen;
function best_of(a) {
if (((p[0] == "seq" || p[0] == "call" || p[0] == "dot" || p[0] == "sub" || p[0] == "conditional") && p[1] === self) ||
self = p;
p = a.pop();
return best_of(a);
var w = ast_walker();
return w.with_walkers({
function(line, i) {
return add_spaces([ "new", parenthesize(ctor, "seq", "binary", "conditional", "assign", function(expr){
w.with_walkers({
} catch(ex) {
throw ex;
}) + args ]);
if (label != null)
if (label != null)
return out;
if (el) {
if (!(expr[0] == "num" || (expr[0] == "unary-prefix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr)))
if (!(expr[0] == "num" || (expr[0] == "unary-postfix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr)))
if (!beautify && el[0] == "atom" && el[1] == "undefined") return i === elements.length - 1 ? "," : "";
// https://github.com/mishoo/UglifyJS/issues/#issue/57
var b = th;
if (name) {
return code;
if (val != null)
return name;
var prev_token;
function custom(){
out: {
if (prev_token) {
break out;
return tok;
return custom;
var ret = {};
if (args === true)
args = {};
return ret;
var MAP;
MAP = function(a, f, o) {
function doit() {
define('uglifyjs/index', ["require", "exports", "module", "./parse-js", "./process", "./consolidator"], function(require, exports, module) {
return final_code;
* see: http://github.com/jrburke/requirejs for details
if (Array.isArray) {
var output = [
i, item;
return output;
if (!node) {
return node;
var newDeps = [],
if (!node) {
* Main parse function. Returns a string of any valid require or define/require.def
* @returns {String} JS source string or null, if no require or define/require.def
var moduleDeps = [],
moduleList = [],
needsDefine = true,
name = null;
if (!deps) {
deps = [];
name = null;
needsDefine = false;
if (!name) {
}, options);
if (result) {
moduleDeps = [];
if (result) {
return result || null;
i, node;
var deps = [],
if (node) {
if (funcArgLength) {
return deps;
n = node[i];
if (callback) {
return callback;
var foundConfig = null,
var jsConfig;
return foundConfig;
return undefined;
return foundConfig;
var dependencies = [],
name = null;
if (deps) {
}, options);
return dependencies;
var dependencies = [],
if (call) {
return dependencies;
uses;
if (!uses) {
uses = {};
return uses;
var uses = null,
assignsExports = false,
assignsExports = true;
if (!uses) {
uses = {};
if (args) {
if (call) {
return uses;
n = node[i];
n = node[i];
if (this.nodeHasRequire(n)) {
var assign;
if (!node) {
* Determines if a specific node is a valid require or define/require.def call.
if (call) {
config = null;
if (!deps) {
if (call) {
//A require.config() or requirejs.config() call.
if (type) {
* call. That includes calls to require/requirejs.config().
if (call) {
//A require.config() or requirejs.config() call.
comment: true
return result;
return parse;
* see: http://github.com/jrburke/requirejs for details
var transform;
return (transform = {
var defineRanges = [],
tokens: true,
range: true
}).tokens;
e.toString());
return contents;
var namespaceExists = false,
if (!prev2) {
} else if (namespace) {
namespaceExists = true;
if (!next2) {
needsId = true;
needsId = true;
needsId = true;
needsId = false;
if (!next3) {
needsId = true;
if (!next3) {
needsId = true;
if (!next3) {
if (!next4) {
needsId = true;
return contents;
return contents;
if (contentInsertion) {
if (onFound) {
return contents;
* see: http://github.com/jrburke/requirejs for details
function Temp() {}
if (mixin) {
var pragma = {
defineTypeFirstCheckRegExp: /\s*["']function["']\s*===\s*typeof\s+define\s*&&\s*define\s*\.\s*amd/g,
defineJQueryRegExp: /typeof\s+define\s*===\s*["']function["']\s*&&\s*define\s*\.\s*amd\s*&&\s*define\s*\.\s*amd\s*\.\s*jQuery/g,
defineHasRegExp: /typeof\s+define\s*==(=)?\s*['"]function['"]\s*&&\s*typeof\s+define\.amd\s*==(=)?\s*['"]object['"]\s*&&\s*define\.amd/g,
defineTernaryRegExp: /typeof\s+define\s*===\s*['"]function["']\s*&&\s*define\s*\.\s*amd\s*\?\s*define/,
amdefineRegExp: /if\s*\(\s*typeof define\s*\!==\s*'function'\s*\)\s*\{\s*[^\{\}]+amdefine[^\{\}]+\}/g,
"typeof " + ns + ".define === 'function' && " + ns + ".define.amd && " + ns + ".define.amd.jQuery");
//Namespace has.js define use:
"typeof " + ns + ".define === 'function' && typeof " + ns + ".define.amd === 'object' && " + ns + ".define.amd");
//Check for require.js with the require/define definitions
endRegExp = new RegExp('\\/\\/\\>\\>\\s*' + type + 'End\\(\\s*[\'"]' + marker + '[\'"]\\s*\\)', "g");
if (endMatches) {
fileName +
if (!collectorMod) {
} catch (eDep) {
return pragma;
* see: http://github.com/jrburke/requirejs for details
* see: http://github.com/jrburke/requirejs for details
accumulator = this[i++];
for (; i < length; i++) {
return accumulator;
JSSourceFilefromCode = java.lang.Class.forName('com.google.javascript.jscomp.JSSourceFile').getMethod('fromCode', [java.lang.String, java.lang.String]);
optimize = {
FLAG_compilation_level = jscomp.CompilationLevel[config.CompilationLevel || 'SIMPLE_OPTIMIZATIONS'];
return fileContents;
return optimize;
* see: http://github.com/jrburke/requirejs for details
var optimize,
return url;
importList = [],
skippedList = [];
fileContents = fileContents.replace(cssImportRegExp, function (fullMatch, urlStart, importFileName, urlEnd, mediaTypes) {
return fullMatch;
return fullMatch;
var fullImportFileName = importFileName.charAt(0) === "/" ? importFileName : filePath + importFileName,
if (fixedUrlMatch.charAt(0) !== "/" && (colonIndex === -1 || colonIndex > fixedUrlMatch.indexOf("/"))) {
return importContents;
return fullMatch;
optimize = {
if (!fileContents) {
if (!optFunc) {
logger.error('Cannot parse file: ' + fileName + ' for comments. Skipping it. Error is:\n' + e.toString());
return fileContents;
fileContents = fileContents.substring(0, startIndex) + fileContents.substring(endIndex + 2, fileContents.length);
if (fileList) {
return buildText;
optimizers: {
if (errMatch) {
return fileContents;
return optimize;
* see: http://github.com/jrburke/requirejs for details
* This file patches require.js to communicate with the build system.
var allowRun = true;
if (!allowRun) {
allowRun = false;
var layer,
//see the node values used for r.js
return url;
var result;
result = function () {
result = function () {
return result;
} catch (e1) {
if (pluginBuilderMatch) {
true).id;
insertNeedsDefine: true,
} catch (e2) {
if (contents) {
if (!e.moduleTree) {
e.moduleTree = [];
} catch (eOuter) {
throw eOuter;
return undefined;
return context;
require({});
buildPathMap: {},
buildFileToModule: {},
buildFilePaths: [],
pathAdded: {},
modulesWithNames: {},
needsDefine: {},
ignoredUrls: {},
return oldContext;
url;
* see: http://github.com/jrburke/requirejs for details
var commonJs = {
useLog: true,
var fileList, i,
return fileContents;
preamble +
console.log("commonJs.convert: COULD NOT CONVERT: " + fileName + ", so skipping it. Error was: " + e);
return fileContents;
return fileContents;
return commonJs;
* see: http://github.com/jrburke/requirejs for details
commonJs) {
endsWithSemiColonRegExp = /;\s*$/;
buildBaseConfig = {
pragmas: {},
paths: {},
inlineText: true,
isBuild: true,
optimizeAllPluginResources: false,
findNestedDependencies: false,
preserveLicenseComments: true,
//By default, all files/directories are copied, unless
return text;
return dirName;
return writeFile;
i, j, errorMod;
"where buildProfile.js is the name of the build file (see example.build.js for hints on how to make a build file).");
return undefined;
if (stackMatch) {
if (errorMod) {
if (stackMatch) {
pluginCollector = {},
//Can now run the patches to require.js to allow it to be used for
requirePatch();
buildPaths = {};
require({
if (modules) {
baseConfig = {
if (modules) {
if (modules) {
if (path) {
config);
//All module layers are done, write out the build.txt file.
if (buildFileContents) {
return buildFileContents;
needArray = {
value = true;
value = false;
path;
var i, prop;
if (obj) {
paths: true,
has: true,
hasOnSave: true,
pragmas: true,
pragmasOnSave: true
if (mainConfigFile) {
} catch (configError) {
if (mainConfig) {
if (buildFileConfig) {
} catch (wrapError) {
return config;
var i, module;
return module;
failedPluginMap = {},
failedPluginIds = [],
errIds = [],
errUrlMap = {},
errUrlConflicts = {},
hasErrUrl = false,
//Reset some state set up in requirePatch.js, and clean up require's
//WARNING: probably not robust for paths and packages/packagePaths,
hasErrUrl = true;
if (hasErrUrl) {
return layer;
if (packageConfig) {
if (builder) {
currContents = 'define({load: function(id){throw new Error("Dynamic load not allowed: " + id);}});';
if (namespace) {
if (packageConfig) {
if (shim) {
fileContents += '\n' + namespaceWithDot + 'require(["' + module.insertRequire.join('", "') + '"]);\n';
if (baseUrl) {
return build;
if (!loadedOptimizedLib) {
loadLib();
loadedOptimizedLib = true;
if (callback) {
if (!callback) {
loadLib();
loadLib();
* see: http://github.com/jrburke/requirejs for details
* Create a build.js file that has the build options you want and pass that
* build file to this file to do the build. See example.build.js for more information.
require({
catchError: {
define: true
loadLib();
loadLib();
showHelp();