mediawiki-extensions-CodeEd.../modules/ace/worker-coffee.js

1 line
180 KiB
JavaScript
Raw Normal View History

function initSender(){var a=require("pilot/event_emitter").EventEmitter,b=require("pilot/oop"),c=function(){};(function(){b.implement(this,a),this.callback=function(a,b){postMessage({type:"call",id:b,data:a})},this.emit=function(a,b){postMessage({type:"event",name:a,data:b})}}).call(c.prototype);return new c}function initBaseUrls(a){require.tlns=a}var console={log:function(a){postMessage({type:"log",data:a})}},window={console:console},require=function(a){var b=require.modules[a];if(b){b.initialized||(b.exports=b.factory().exports,b.initialized=!0);return b.exports}var c=a.split("/");c[0]=require.tlns[c[0]]||c[0],path=c.join("/")+".js",require.id=a,importScripts(path);return require(a)};require.modules={},require.tlns={};var define=function(a,b,c){arguments.length==2?c=b:arguments.length==1&&(c=a,a=require.id);a.indexOf("text/")!==0&&(require.modules[a]={factory:function(){var a={exports:{}},b=c(require,a.exports,a);b&&(a.exports=b);return a}})},main,sender;onmessage=function(a){var b=a.data;if(b.command)main[b.command].apply(main,b.args);else if(b.init){initBaseUrls(b.tlns),require("pilot/fixoldbrowsers"),sender=initSender();var c=require(b.module)[b.classname];main=new c(sender)}else b.event&&sender&&sender._dispatchEvent(b.event,b.data)},define("pilot/fixoldbrowsers",["require","exports","module"],function(a,b,c){if(!Function.prototype.bind){var d=Array.prototype.slice;Function.prototype.bind=function e(a){var b=this;if(typeof b.apply!=="function"||typeof b.call!=="function")return new TypeError;var c=d.call(arguments),e=function e(){if(this instanceof e){var a=Object.create(b.prototype);b.apply(a,c.concat(d.call(arguments)));return a}return b.call.apply(b,c.concat(d.call(arguments)))};e.length=typeof b==="function"?Math.max(b.length-c.length,0):0;return e}}var f=Function.prototype.call,g=Array.prototype,h=Object.prototype,i=f.bind(h.hasOwnProperty),j,k,l,m,n;if(n=i(h,"__defineGetter__"))j=f.bind(h.__defineGetter__),k=f.bind(h.__defineSetter__),l=f.bind(h.__lookupGetter__),m=f.bind(h.__lookupSetter__);Array.isArray||(Array.isArray=function o(a){return Object.prototype.toString.call(a)==="[object Array]"}),Array.prototype.forEach||(Array.prototype.forEach=function p(a,b){var c=+this.length;for(var d=0;d<c;d++)d in this&&a.call(b,this[d],d,this)}),Array.prototype.map||(Array.prototype.map=function q(a){var b=+this.length;if(typeof a!=="function")throw new TypeError;var c=Array(b),d=arguments[1];for(var e=0;e<b;e++)e in this&&(c[e]=a.call(d,this[e],e,this));return c}),Array.prototype.filter||(Array.prototype.filter=function r(a){var b=[],c=arguments[1];for(var d=0;d<this.length;d++)a.call(c,this[d])&&b.push(this[d]);return b}),Array.prototype.every||(Array.prototype.every=function s(a){var b=arguments[1];for(var c=0;c<this.length;c++)if(!a.call(b,this[c]))return!1;return!0}),Array.prototype.some||(Array.prototype.some=function t(a){var b=arguments[1];for(var c=0;c<this.length;c++)if(a.call(b,this[c]))return!0;return!1}),Array.prototype.reduce||(Array.prototype.reduce=function u(a){var b=+this.length;if(typeof a!=="function")throw new TypeError;if(b===0&&arguments.length===1)throw new TypeError;var c=0;if(arguments.length<2){do{if(c in this){d=this[c++];break}if(++c>=b)throw new TypeError}while(!0)}else var d=arguments[1];for(;c<b;c++)c in this&&(d=a.call(null,d,this[c],c,this));return d}),Array.prototype.reduceRight||(Array.prototype.reduceRight=function v(a){var b=+this.length;if(typeof a!=="function")throw new TypeError;if(b===0&&arguments.length===1)throw new TypeError;var c=b-1;if(arguments.length<2){do{if(c in this){d=this[c--];break}if(--c<0)throw new TypeError}while(!0)}else var d=arguments[1];for(;c>=0;c--)c in this&&(d=a.call(null,d,this[c],c,this));return d}),Array.prototype.indexOf||(Array.prototype.indexOf=function w(a){var b=this.length;if(!b)return-1;var c=arguments[1]||0;if(c>=b)return-1;c<0&&(c+=b);for(;c<b;c++){if(!i(this,c))continue;if(a===this[c])return c}return-1}),Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function x(a){var b=this.length;if(!b)return-1;var c=arguments[1]||b;c<0&&(c+=b)