ace-rails-ap 4.3 → 4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (249) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/ace-rails-ap.gemspec +0 -2
  4. data/lib/ace/rails/version.rb +1 -1
  5. data/vendor/assets/javascripts/ace/ace.js +659 -1137
  6. data/vendor/assets/javascripts/ace/ext-beautify.js +5 -2
  7. data/vendor/assets/javascripts/ace/ext-code_lens.js +238 -0
  8. data/vendor/assets/javascripts/ace/ext-emmet.js +36 -28
  9. data/vendor/assets/javascripts/ace/ext-language_tools.js +63 -48
  10. data/vendor/assets/javascripts/ace/ext-modelist.js +12 -6
  11. data/vendor/assets/javascripts/ace/ext-options.js +46 -19
  12. data/vendor/assets/javascripts/ace/ext-prompt.js +57 -38
  13. data/vendor/assets/javascripts/ace/ext-settings_menu.js +46 -19
  14. data/vendor/assets/javascripts/ace/ext-spellcheck.js +0 -1
  15. data/vendor/assets/javascripts/ace/ext-themelist.js +2 -1
  16. data/vendor/assets/javascripts/ace/keybinding-emacs.js +21 -22
  17. data/vendor/assets/javascripts/ace/keybinding-sublime.js +2 -5
  18. data/vendor/assets/javascripts/ace/keybinding-vim.js +45 -9
  19. data/vendor/assets/javascripts/ace/keybinding-vscode.js +262 -0
  20. data/vendor/assets/javascripts/ace/mode-abc.js +3 -0
  21. data/vendor/assets/javascripts/ace/mode-actionscript.js +1 -0
  22. data/vendor/assets/javascripts/ace/mode-alda.js +311 -0
  23. data/vendor/assets/javascripts/ace/mode-asl.js +17 -16
  24. data/vendor/assets/javascripts/ace/mode-c_cpp.js +1 -0
  25. data/vendor/assets/javascripts/ace/mode-clojure.js +1 -0
  26. data/vendor/assets/javascripts/ace/mode-coffee.js +1 -0
  27. data/vendor/assets/javascripts/ace/mode-coldfusion.js +3 -0
  28. data/vendor/assets/javascripts/ace/mode-csound_document.js +40 -5
  29. data/vendor/assets/javascripts/ace/mode-csound_orchestra.js +37 -5
  30. data/vendor/assets/javascripts/ace/mode-csound_score.js +1 -0
  31. data/vendor/assets/javascripts/ace/mode-css.js +1 -0
  32. data/vendor/assets/javascripts/ace/mode-curly.js +3 -0
  33. data/vendor/assets/javascripts/ace/mode-d.js +1 -1
  34. data/vendor/assets/javascripts/ace/mode-dart.js +2 -0
  35. data/vendor/assets/javascripts/ace/mode-diff.js +1 -0
  36. data/vendor/assets/javascripts/ace/mode-django.js +4 -0
  37. data/vendor/assets/javascripts/ace/mode-dockerfile.js +1 -0
  38. data/vendor/assets/javascripts/ace/mode-drools.js +1 -0
  39. data/vendor/assets/javascripts/ace/mode-edifact.js +1 -0
  40. data/vendor/assets/javascripts/ace/mode-ejs.js +673 -165
  41. data/vendor/assets/javascripts/ace/mode-erlang.js +1 -0
  42. data/vendor/assets/javascripts/ace/mode-fsl.js +1 -0
  43. data/vendor/assets/javascripts/ace/mode-glsl.js +1 -0
  44. data/vendor/assets/javascripts/ace/mode-gobstones.js +2 -0
  45. data/vendor/assets/javascripts/ace/mode-graphqlschema.js +1 -0
  46. data/vendor/assets/javascripts/ace/mode-groovy.js +1 -0
  47. data/vendor/assets/javascripts/ace/mode-haml.js +419 -104
  48. data/vendor/assets/javascripts/ace/mode-handlebars.js +3 -0
  49. data/vendor/assets/javascripts/ace/mode-haskell.js +1 -0
  50. data/vendor/assets/javascripts/ace/mode-html.js +3 -0
  51. data/vendor/assets/javascripts/ace/mode-html_elixir.js +3 -0
  52. data/vendor/assets/javascripts/ace/mode-html_ruby.js +673 -165
  53. data/vendor/assets/javascripts/ace/mode-io.js +1 -0
  54. data/vendor/assets/javascripts/ace/mode-java.js +2 -0
  55. data/vendor/assets/javascripts/ace/mode-javascript.js +1 -0
  56. data/vendor/assets/javascripts/ace/mode-json.js +3 -0
  57. data/vendor/assets/javascripts/ace/mode-json5.js +360 -0
  58. data/vendor/assets/javascripts/ace/mode-jsoniq.js +1 -0
  59. data/vendor/assets/javascripts/ace/mode-jsp.js +1 -0
  60. data/vendor/assets/javascripts/ace/mode-kotlin.js +2 -0
  61. data/vendor/assets/javascripts/ace/mode-liquid.js +4 -0
  62. data/vendor/assets/javascripts/ace/mode-lsl.js +1 -0
  63. data/vendor/assets/javascripts/ace/mode-lua.js +1 -0
  64. data/vendor/assets/javascripts/ace/mode-luapage.js +4 -0
  65. data/vendor/assets/javascripts/ace/mode-makefile.js +1 -0
  66. data/vendor/assets/javascripts/ace/mode-markdown.js +5 -0
  67. data/vendor/assets/javascripts/ace/mode-maze.js +1 -0
  68. data/vendor/assets/javascripts/ace/mode-mediawiki.js +592 -0
  69. data/vendor/assets/javascripts/ace/mode-nix.js +1 -0
  70. data/vendor/assets/javascripts/ace/mode-nsis.js +1 -1
  71. data/vendor/assets/javascripts/ace/mode-nunjucks.js +2698 -0
  72. data/vendor/assets/javascripts/ace/mode-perl.js +1 -0
  73. data/vendor/assets/javascripts/ace/mode-pgsql.js +2 -2
  74. data/vendor/assets/javascripts/ace/mode-php.js +4 -0
  75. data/vendor/assets/javascripts/ace/mode-php_laravel_blade.js +4 -0
  76. data/vendor/assets/javascripts/ace/mode-prisma.js +489 -0
  77. data/vendor/assets/javascripts/ace/mode-protobuf.js +1 -0
  78. data/vendor/assets/javascripts/ace/mode-puppet.js +5 -6
  79. data/vendor/assets/javascripts/ace/mode-python.js +3 -2
  80. data/vendor/assets/javascripts/ace/mode-qml.js +381 -0
  81. data/vendor/assets/javascripts/ace/mode-r.js +1 -0
  82. data/vendor/assets/javascripts/ace/mode-razor.js +4 -0
  83. data/vendor/assets/javascripts/ace/mode-rhtml.js +3 -0
  84. data/vendor/assets/javascripts/ace/mode-rst.js +1 -0
  85. data/vendor/assets/javascripts/ace/mode-ruby.js +670 -165
  86. data/vendor/assets/javascripts/ace/mode-rust.js +1 -1
  87. data/vendor/assets/javascripts/ace/mode-scala.js +1 -0
  88. data/vendor/assets/javascripts/ace/mode-sh.js +1 -0
  89. data/vendor/assets/javascripts/ace/mode-sjs.js +1 -0
  90. data/vendor/assets/javascripts/ace/mode-slim.js +708 -110
  91. data/vendor/assets/javascripts/ace/mode-smarty.js +3 -0
  92. data/vendor/assets/javascripts/ace/mode-snippets.js +1 -0
  93. data/vendor/assets/javascripts/ace/mode-soy_template.js +3 -0
  94. data/vendor/assets/javascripts/ace/mode-sql.js +1 -0
  95. data/vendor/assets/javascripts/ace/mode-sqlserver.js +2 -1
  96. data/vendor/assets/javascripts/ace/mode-svg.js +1 -0
  97. data/vendor/assets/javascripts/ace/mode-swift.js +6 -0
  98. data/vendor/assets/javascripts/ace/mode-tcl.js +1 -0
  99. data/vendor/assets/javascripts/ace/mode-terraform.js +10 -7
  100. data/vendor/assets/javascripts/ace/mode-tex.js +1 -0
  101. data/vendor/assets/javascripts/ace/mode-textile.js +1 -0
  102. data/vendor/assets/javascripts/ace/mode-tsx.js +1 -0
  103. data/vendor/assets/javascripts/ace/mode-twig.js +3 -0
  104. data/vendor/assets/javascripts/ace/mode-typescript.js +1 -0
  105. data/vendor/assets/javascripts/ace/mode-vala.js +1 -0
  106. data/vendor/assets/javascripts/ace/mode-vbscript.js +444 -15
  107. data/vendor/assets/javascripts/ace/mode-velocity.js +4 -0
  108. data/vendor/assets/javascripts/ace/mode-vhdl.js +5 -6
  109. data/vendor/assets/javascripts/ace/mode-visualforce.js +3 -0
  110. data/vendor/assets/javascripts/ace/mode-wollok.js +2 -0
  111. data/vendor/assets/javascripts/ace/mode-xquery.js +1 -0
  112. data/vendor/assets/javascripts/ace/snippets/abap.js +1 -6
  113. data/vendor/assets/javascripts/ace/snippets/ada.js +1 -6
  114. data/vendor/assets/javascripts/ace/snippets/alda.js +9 -0
  115. data/vendor/assets/javascripts/ace/snippets/apache_conf.js +1 -6
  116. data/vendor/assets/javascripts/ace/snippets/apex.js +1 -6
  117. data/vendor/assets/javascripts/ace/snippets/applescript.js +1 -6
  118. data/vendor/assets/javascripts/ace/snippets/aql.js +1 -6
  119. data/vendor/assets/javascripts/ace/snippets/asciidoc.js +1 -6
  120. data/vendor/assets/javascripts/ace/snippets/asl.js +1 -5
  121. data/vendor/assets/javascripts/ace/snippets/assembly_x86.js +1 -6
  122. data/vendor/assets/javascripts/ace/snippets/autohotkey.js +1 -6
  123. data/vendor/assets/javascripts/ace/snippets/batchfile.js +1 -6
  124. data/vendor/assets/javascripts/ace/snippets/c9search.js +1 -6
  125. data/vendor/assets/javascripts/ace/snippets/cirru.js +1 -6
  126. data/vendor/assets/javascripts/ace/snippets/cobol.js +1 -6
  127. data/vendor/assets/javascripts/ace/snippets/coldfusion.js +1 -6
  128. data/vendor/assets/javascripts/ace/snippets/crystal.js +1 -6
  129. data/vendor/assets/javascripts/ace/snippets/csharp.js +1 -6
  130. data/vendor/assets/javascripts/ace/snippets/csound_score.js +1 -6
  131. data/vendor/assets/javascripts/ace/snippets/csp.js +1 -6
  132. data/vendor/assets/javascripts/ace/snippets/curly.js +1 -6
  133. data/vendor/assets/javascripts/ace/snippets/d.js +1 -6
  134. data/vendor/assets/javascripts/ace/snippets/dockerfile.js +1 -6
  135. data/vendor/assets/javascripts/ace/snippets/dot.js +1 -6
  136. data/vendor/assets/javascripts/ace/snippets/eiffel.js +1 -6
  137. data/vendor/assets/javascripts/ace/snippets/ejs.js +1 -6
  138. data/vendor/assets/javascripts/ace/snippets/elixir.js +1 -6
  139. data/vendor/assets/javascripts/ace/snippets/elm.js +1 -6
  140. data/vendor/assets/javascripts/ace/snippets/forth.js +1 -6
  141. data/vendor/assets/javascripts/ace/snippets/fortran.js +1 -6
  142. data/vendor/assets/javascripts/ace/snippets/fsharp.js +1 -6
  143. data/vendor/assets/javascripts/ace/snippets/ftl.js +1 -6
  144. data/vendor/assets/javascripts/ace/snippets/gcode.js +1 -6
  145. data/vendor/assets/javascripts/ace/snippets/gherkin.js +1 -6
  146. data/vendor/assets/javascripts/ace/snippets/gitignore.js +1 -6
  147. data/vendor/assets/javascripts/ace/snippets/glsl.js +1 -6
  148. data/vendor/assets/javascripts/ace/snippets/golang.js +1 -6
  149. data/vendor/assets/javascripts/ace/snippets/groovy.js +1 -6
  150. data/vendor/assets/javascripts/ace/snippets/handlebars.js +1 -6
  151. data/vendor/assets/javascripts/ace/snippets/haskell_cabal.js +1 -6
  152. data/vendor/assets/javascripts/ace/snippets/haxe.js +1 -6
  153. data/vendor/assets/javascripts/ace/snippets/hjson.js +1 -6
  154. data/vendor/assets/javascripts/ace/snippets/html_elixir.js +1 -6
  155. data/vendor/assets/javascripts/ace/snippets/html_ruby.js +1 -6
  156. data/vendor/assets/javascripts/ace/snippets/ini.js +1 -6
  157. data/vendor/assets/javascripts/ace/snippets/jack.js +1 -6
  158. data/vendor/assets/javascripts/ace/snippets/jade.js +1 -6
  159. data/vendor/assets/javascripts/ace/snippets/json.js +1 -6
  160. data/vendor/assets/javascripts/ace/snippets/json5.js +9 -0
  161. data/vendor/assets/javascripts/ace/snippets/jssm.js +1 -6
  162. data/vendor/assets/javascripts/ace/snippets/jsx.js +1 -6
  163. data/vendor/assets/javascripts/ace/snippets/julia.js +1 -6
  164. data/vendor/assets/javascripts/ace/snippets/kotlin.js +1 -6
  165. data/vendor/assets/javascripts/ace/snippets/latex.js +1 -6
  166. data/vendor/assets/javascripts/ace/snippets/less.js +1 -6
  167. data/vendor/assets/javascripts/ace/snippets/lisp.js +1 -6
  168. data/vendor/assets/javascripts/ace/snippets/livescript.js +1 -6
  169. data/vendor/assets/javascripts/ace/snippets/logiql.js +1 -6
  170. data/vendor/assets/javascripts/ace/snippets/logtalk.js +1 -6
  171. data/vendor/assets/javascripts/ace/snippets/luapage.js +1 -6
  172. data/vendor/assets/javascripts/ace/snippets/lucene.js +1 -6
  173. data/vendor/assets/javascripts/ace/snippets/mask.js +1 -6
  174. data/vendor/assets/javascripts/ace/snippets/matlab.js +1 -6
  175. data/vendor/assets/javascripts/ace/snippets/mediawiki.js +9 -0
  176. data/vendor/assets/javascripts/ace/snippets/mel.js +1 -6
  177. data/vendor/assets/javascripts/ace/snippets/mixal.js +1 -6
  178. data/vendor/assets/javascripts/ace/snippets/mushcode.js +1 -6
  179. data/vendor/assets/javascripts/ace/snippets/mysql.js +1 -6
  180. data/vendor/assets/javascripts/ace/snippets/nginx.js +1 -6
  181. data/vendor/assets/javascripts/ace/snippets/nim.js +1 -6
  182. data/vendor/assets/javascripts/ace/snippets/nix.js +1 -6
  183. data/vendor/assets/javascripts/ace/snippets/nsis.js +1 -6
  184. data/vendor/assets/javascripts/ace/snippets/nunjucks.js +9 -0
  185. data/vendor/assets/javascripts/ace/snippets/objectivec.js +1 -6
  186. data/vendor/assets/javascripts/ace/snippets/ocaml.js +1 -6
  187. data/vendor/assets/javascripts/ace/snippets/pascal.js +1 -6
  188. data/vendor/assets/javascripts/ace/snippets/perl6.js +1 -6
  189. data/vendor/assets/javascripts/ace/snippets/pgsql.js +1 -6
  190. data/vendor/assets/javascripts/ace/snippets/php_laravel_blade.js +1 -6
  191. data/vendor/assets/javascripts/ace/snippets/pig.js +1 -6
  192. data/vendor/assets/javascripts/ace/snippets/plain_text.js +1 -6
  193. data/vendor/assets/javascripts/ace/snippets/powershell.js +1 -6
  194. data/vendor/assets/javascripts/ace/snippets/praat.js +1 -6
  195. data/vendor/assets/javascripts/ace/snippets/prisma.js +9 -0
  196. data/vendor/assets/javascripts/ace/snippets/prolog.js +1 -6
  197. data/vendor/assets/javascripts/ace/snippets/properties.js +1 -6
  198. data/vendor/assets/javascripts/ace/snippets/protobuf.js +1 -6
  199. data/vendor/assets/javascripts/ace/snippets/puppet.js +1 -6
  200. data/vendor/assets/javascripts/ace/snippets/qml.js +9 -0
  201. data/vendor/assets/javascripts/ace/snippets/rdoc.js +1 -6
  202. data/vendor/assets/javascripts/ace/snippets/red.js +1 -6
  203. data/vendor/assets/javascripts/ace/snippets/redshift.js +1 -6
  204. data/vendor/assets/javascripts/ace/snippets/rhtml.js +1 -6
  205. data/vendor/assets/javascripts/ace/snippets/rust.js +1 -6
  206. data/vendor/assets/javascripts/ace/snippets/sass.js +1 -6
  207. data/vendor/assets/javascripts/ace/snippets/scad.js +1 -6
  208. data/vendor/assets/javascripts/ace/snippets/scala.js +1 -6
  209. data/vendor/assets/javascripts/ace/snippets/scheme.js +1 -6
  210. data/vendor/assets/javascripts/ace/snippets/scss.js +1 -6
  211. data/vendor/assets/javascripts/ace/snippets/sjs.js +1 -6
  212. data/vendor/assets/javascripts/ace/snippets/slim.js +1 -6
  213. data/vendor/assets/javascripts/ace/snippets/smarty.js +1 -6
  214. data/vendor/assets/javascripts/ace/snippets/soy_template.js +1 -6
  215. data/vendor/assets/javascripts/ace/snippets/space.js +1 -6
  216. data/vendor/assets/javascripts/ace/snippets/sparql.js +1 -6
  217. data/vendor/assets/javascripts/ace/snippets/stylus.js +1 -6
  218. data/vendor/assets/javascripts/ace/snippets/svg.js +1 -6
  219. data/vendor/assets/javascripts/ace/snippets/swift.js +1 -6
  220. data/vendor/assets/javascripts/ace/snippets/terraform.js +1 -6
  221. data/vendor/assets/javascripts/ace/snippets/text.js +1 -6
  222. data/vendor/assets/javascripts/ace/snippets/toml.js +1 -6
  223. data/vendor/assets/javascripts/ace/snippets/tsx.js +1 -6
  224. data/vendor/assets/javascripts/ace/snippets/turtle.js +1 -6
  225. data/vendor/assets/javascripts/ace/snippets/twig.js +1 -6
  226. data/vendor/assets/javascripts/ace/snippets/typescript.js +1 -6
  227. data/vendor/assets/javascripts/ace/snippets/vbscript.js +1 -6
  228. data/vendor/assets/javascripts/ace/snippets/verilog.js +1 -6
  229. data/vendor/assets/javascripts/ace/snippets/vhdl.js +1 -6
  230. data/vendor/assets/javascripts/ace/snippets/visualforce.js +1 -6
  231. data/vendor/assets/javascripts/ace/snippets/xml.js +1 -6
  232. data/vendor/assets/javascripts/ace/snippets/yaml.js +1 -6
  233. data/vendor/assets/javascripts/ace/snippets/zeek.js +1 -6
  234. data/vendor/assets/javascripts/ace/theme-ambiance.js +3 -2
  235. data/vendor/assets/javascripts/ace/theme-chaos.js +1 -1
  236. data/vendor/assets/javascripts/ace/theme-nord_dark.js +102 -0
  237. data/vendor/assets/javascripts/ace/worker-base.js +1421 -0
  238. data/vendor/assets/javascripts/ace/worker-coffee.js +17 -703
  239. data/vendor/assets/javascripts/ace/worker-css.js +17 -703
  240. data/vendor/assets/javascripts/ace/worker-html.js +17 -703
  241. data/vendor/assets/javascripts/ace/worker-javascript.js +7833 -5352
  242. data/vendor/assets/javascripts/ace/worker-json.js +17 -703
  243. data/vendor/assets/javascripts/ace/worker-lua.js +17 -703
  244. data/vendor/assets/javascripts/ace/worker-php.js +857 -1475
  245. data/vendor/assets/javascripts/ace/worker-xml.js +26 -707
  246. data/vendor/assets/javascripts/ace/worker-xquery.js +17 -703
  247. metadata +18 -4
  248. data/vendor/assets/javascripts/ace/mode-bro.js +0 -334
  249. data/vendor/assets/javascripts/ace/snippets/bro.js +0 -14
@@ -209,7 +209,6 @@ window.onmessage = function(e) {
209
209
  }
210
210
  else if (msg.init) {
211
211
  window.initBaseUrls(msg.tlns);
212
- require("ace/lib/es5-shim");
213
212
  sender = window.sender = window.initSender();
214
213
  var clazz = require(msg.module)[msg.classname];
215
214
  main = window.main = new clazz(sender);
@@ -787,8 +786,8 @@ EventEmitter._signal = function(eventName, e) {
787
786
 
788
787
  EventEmitter.once = function(eventName, callback) {
789
788
  var _self = this;
790
- this.addEventListener(eventName, function newCallback() {
791
- _self.removeEventListener(eventName, newCallback);
789
+ this.on(eventName, function newCallback() {
790
+ _self.off(eventName, newCallback);
792
791
  callback.apply(null, arguments);
793
792
  });
794
793
  if (!callback) {
@@ -860,7 +859,9 @@ EventEmitter.removeEventListener = function(eventName, callback) {
860
859
  };
861
860
 
862
861
  EventEmitter.removeAllListeners = function(eventName) {
863
- if (this._eventRegistry) this._eventRegistry[eventName] = [];
862
+ if (!eventName) this._eventRegistry = this._defaultHandlers = undefined;
863
+ if (this._eventRegistry) this._eventRegistry[eventName] = undefined;
864
+ if (this._defaultHandlers) this._defaultHandlers[eventName] = undefined;
864
865
  };
865
866
 
866
867
  exports.EventEmitter = EventEmitter;
@@ -960,7 +961,7 @@ var Anchor = exports.Anchor = function(doc, row, column) {
960
961
  });
961
962
  };
962
963
  this.detach = function() {
963
- this.document.removeEventListener("change", this.$onChange);
964
+ this.document.off("change", this.$onChange);
964
965
  };
965
966
  this.attach = function(doc) {
966
967
  this.document = doc || this.document;
@@ -1292,6 +1293,16 @@ var Document = function(textOrLines) {
1292
1293
  }
1293
1294
  };
1294
1295
 
1296
+ this.$safeApplyDelta = function(delta) {
1297
+ var docLength = this.$lines.length;
1298
+ if (
1299
+ delta.action == "remove" && delta.start.row < docLength && delta.end.row < docLength
1300
+ || delta.action == "insert" && delta.start.row <= docLength
1301
+ ) {
1302
+ this.applyDelta(delta);
1303
+ }
1304
+ };
1305
+
1295
1306
  this.$splitAndapplyLargeDelta = function(delta, MAX) {
1296
1307
  var lines = delta.lines;
1297
1308
  var l = lines.length - MAX + 1;
@@ -1314,7 +1325,7 @@ var Document = function(textOrLines) {
1314
1325
  this.applyDelta(delta, true);
1315
1326
  };
1316
1327
  this.revertDelta = function(delta) {
1317
- this.applyDelta({
1328
+ this.$safeApplyDelta({
1318
1329
  start: this.clonePos(delta.start),
1319
1330
  end: this.clonePos(delta.end),
1320
1331
  action: (delta.action == "insert" ? "remove" : "insert"),
@@ -8074,700 +8085,3 @@ oop.inherits(Worker, Mirror);
8074
8085
  }).call(Worker.prototype);
8075
8086
 
8076
8087
  });
8077
-
8078
- define("ace/lib/es5-shim",[], function(require, exports, module) {
8079
-
8080
- function Empty() {}
8081
-
8082
- if (!Function.prototype.bind) {
8083
- Function.prototype.bind = function bind(that) { // .length is 1
8084
- var target = this;
8085
- if (typeof target != "function") {
8086
- throw new TypeError("Function.prototype.bind called on incompatible " + target);
8087
- }
8088
- var args = slice.call(arguments, 1); // for normal call
8089
- var bound = function () {
8090
-
8091
- if (this instanceof bound) {
8092
-
8093
- var result = target.apply(
8094
- this,
8095
- args.concat(slice.call(arguments))
8096
- );
8097
- if (Object(result) === result) {
8098
- return result;
8099
- }
8100
- return this;
8101
-
8102
- } else {
8103
- return target.apply(
8104
- that,
8105
- args.concat(slice.call(arguments))
8106
- );
8107
-
8108
- }
8109
-
8110
- };
8111
- if(target.prototype) {
8112
- Empty.prototype = target.prototype;
8113
- bound.prototype = new Empty();
8114
- Empty.prototype = null;
8115
- }
8116
- return bound;
8117
- };
8118
- }
8119
- var call = Function.prototype.call;
8120
- var prototypeOfArray = Array.prototype;
8121
- var prototypeOfObject = Object.prototype;
8122
- var slice = prototypeOfArray.slice;
8123
- var _toString = call.bind(prototypeOfObject.toString);
8124
- var owns = call.bind(prototypeOfObject.hasOwnProperty);
8125
- var defineGetter;
8126
- var defineSetter;
8127
- var lookupGetter;
8128
- var lookupSetter;
8129
- var supportsAccessors;
8130
- if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) {
8131
- defineGetter = call.bind(prototypeOfObject.__defineGetter__);
8132
- defineSetter = call.bind(prototypeOfObject.__defineSetter__);
8133
- lookupGetter = call.bind(prototypeOfObject.__lookupGetter__);
8134
- lookupSetter = call.bind(prototypeOfObject.__lookupSetter__);
8135
- }
8136
- if ([1,2].splice(0).length != 2) {
8137
- if(function() { // test IE < 9 to splice bug - see issue #138
8138
- function makeArray(l) {
8139
- var a = new Array(l+2);
8140
- a[0] = a[1] = 0;
8141
- return a;
8142
- }
8143
- var array = [], lengthBefore;
8144
-
8145
- array.splice.apply(array, makeArray(20));
8146
- array.splice.apply(array, makeArray(26));
8147
-
8148
- lengthBefore = array.length; //46
8149
- array.splice(5, 0, "XXX"); // add one element
8150
-
8151
- lengthBefore + 1 == array.length
8152
-
8153
- if (lengthBefore + 1 == array.length) {
8154
- return true;// has right splice implementation without bugs
8155
- }
8156
- }()) {//IE 6/7
8157
- var array_splice = Array.prototype.splice;
8158
- Array.prototype.splice = function(start, deleteCount) {
8159
- if (!arguments.length) {
8160
- return [];
8161
- } else {
8162
- return array_splice.apply(this, [
8163
- start === void 0 ? 0 : start,
8164
- deleteCount === void 0 ? (this.length - start) : deleteCount
8165
- ].concat(slice.call(arguments, 2)))
8166
- }
8167
- };
8168
- } else {//IE8
8169
- Array.prototype.splice = function(pos, removeCount){
8170
- var length = this.length;
8171
- if (pos > 0) {
8172
- if (pos > length)
8173
- pos = length;
8174
- } else if (pos == void 0) {
8175
- pos = 0;
8176
- } else if (pos < 0) {
8177
- pos = Math.max(length + pos, 0);
8178
- }
8179
-
8180
- if (!(pos+removeCount < length))
8181
- removeCount = length - pos;
8182
-
8183
- var removed = this.slice(pos, pos+removeCount);
8184
- var insert = slice.call(arguments, 2);
8185
- var add = insert.length;
8186
- if (pos === length) {
8187
- if (add) {
8188
- this.push.apply(this, insert);
8189
- }
8190
- } else {
8191
- var remove = Math.min(removeCount, length - pos);
8192
- var tailOldPos = pos + remove;
8193
- var tailNewPos = tailOldPos + add - remove;
8194
- var tailCount = length - tailOldPos;
8195
- var lengthAfterRemove = length - remove;
8196
-
8197
- if (tailNewPos < tailOldPos) { // case A
8198
- for (var i = 0; i < tailCount; ++i) {
8199
- this[tailNewPos+i] = this[tailOldPos+i];
8200
- }
8201
- } else if (tailNewPos > tailOldPos) { // case B
8202
- for (i = tailCount; i--; ) {
8203
- this[tailNewPos+i] = this[tailOldPos+i];
8204
- }
8205
- } // else, add == remove (nothing to do)
8206
-
8207
- if (add && pos === lengthAfterRemove) {
8208
- this.length = lengthAfterRemove; // truncate array
8209
- this.push.apply(this, insert);
8210
- } else {
8211
- this.length = lengthAfterRemove + add; // reserves space
8212
- for (i = 0; i < add; ++i) {
8213
- this[pos+i] = insert[i];
8214
- }
8215
- }
8216
- }
8217
- return removed;
8218
- };
8219
- }
8220
- }
8221
- if (!Array.isArray) {
8222
- Array.isArray = function isArray(obj) {
8223
- return _toString(obj) == "[object Array]";
8224
- };
8225
- }
8226
- var boxedString = Object("a"),
8227
- splitString = boxedString[0] != "a" || !(0 in boxedString);
8228
-
8229
- if (!Array.prototype.forEach) {
8230
- Array.prototype.forEach = function forEach(fun /*, thisp*/) {
8231
- var object = toObject(this),
8232
- self = splitString && _toString(this) == "[object String]" ?
8233
- this.split("") :
8234
- object,
8235
- thisp = arguments[1],
8236
- i = -1,
8237
- length = self.length >>> 0;
8238
- if (_toString(fun) != "[object Function]") {
8239
- throw new TypeError(); // TODO message
8240
- }
8241
-
8242
- while (++i < length) {
8243
- if (i in self) {
8244
- fun.call(thisp, self[i], i, object);
8245
- }
8246
- }
8247
- };
8248
- }
8249
- if (!Array.prototype.map) {
8250
- Array.prototype.map = function map(fun /*, thisp*/) {
8251
- var object = toObject(this),
8252
- self = splitString && _toString(this) == "[object String]" ?
8253
- this.split("") :
8254
- object,
8255
- length = self.length >>> 0,
8256
- result = Array(length),
8257
- thisp = arguments[1];
8258
- if (_toString(fun) != "[object Function]") {
8259
- throw new TypeError(fun + " is not a function");
8260
- }
8261
-
8262
- for (var i = 0; i < length; i++) {
8263
- if (i in self)
8264
- result[i] = fun.call(thisp, self[i], i, object);
8265
- }
8266
- return result;
8267
- };
8268
- }
8269
- if (!Array.prototype.filter) {
8270
- Array.prototype.filter = function filter(fun /*, thisp */) {
8271
- var object = toObject(this),
8272
- self = splitString && _toString(this) == "[object String]" ?
8273
- this.split("") :
8274
- object,
8275
- length = self.length >>> 0,
8276
- result = [],
8277
- value,
8278
- thisp = arguments[1];
8279
- if (_toString(fun) != "[object Function]") {
8280
- throw new TypeError(fun + " is not a function");
8281
- }
8282
-
8283
- for (var i = 0; i < length; i++) {
8284
- if (i in self) {
8285
- value = self[i];
8286
- if (fun.call(thisp, value, i, object)) {
8287
- result.push(value);
8288
- }
8289
- }
8290
- }
8291
- return result;
8292
- };
8293
- }
8294
- if (!Array.prototype.every) {
8295
- Array.prototype.every = function every(fun /*, thisp */) {
8296
- var object = toObject(this),
8297
- self = splitString && _toString(this) == "[object String]" ?
8298
- this.split("") :
8299
- object,
8300
- length = self.length >>> 0,
8301
- thisp = arguments[1];
8302
- if (_toString(fun) != "[object Function]") {
8303
- throw new TypeError(fun + " is not a function");
8304
- }
8305
-
8306
- for (var i = 0; i < length; i++) {
8307
- if (i in self && !fun.call(thisp, self[i], i, object)) {
8308
- return false;
8309
- }
8310
- }
8311
- return true;
8312
- };
8313
- }
8314
- if (!Array.prototype.some) {
8315
- Array.prototype.some = function some(fun /*, thisp */) {
8316
- var object = toObject(this),
8317
- self = splitString && _toString(this) == "[object String]" ?
8318
- this.split("") :
8319
- object,
8320
- length = self.length >>> 0,
8321
- thisp = arguments[1];
8322
- if (_toString(fun) != "[object Function]") {
8323
- throw new TypeError(fun + " is not a function");
8324
- }
8325
-
8326
- for (var i = 0; i < length; i++) {
8327
- if (i in self && fun.call(thisp, self[i], i, object)) {
8328
- return true;
8329
- }
8330
- }
8331
- return false;
8332
- };
8333
- }
8334
- if (!Array.prototype.reduce) {
8335
- Array.prototype.reduce = function reduce(fun /*, initial*/) {
8336
- var object = toObject(this),
8337
- self = splitString && _toString(this) == "[object String]" ?
8338
- this.split("") :
8339
- object,
8340
- length = self.length >>> 0;
8341
- if (_toString(fun) != "[object Function]") {
8342
- throw new TypeError(fun + " is not a function");
8343
- }
8344
- if (!length && arguments.length == 1) {
8345
- throw new TypeError("reduce of empty array with no initial value");
8346
- }
8347
-
8348
- var i = 0;
8349
- var result;
8350
- if (arguments.length >= 2) {
8351
- result = arguments[1];
8352
- } else {
8353
- do {
8354
- if (i in self) {
8355
- result = self[i++];
8356
- break;
8357
- }
8358
- if (++i >= length) {
8359
- throw new TypeError("reduce of empty array with no initial value");
8360
- }
8361
- } while (true);
8362
- }
8363
-
8364
- for (; i < length; i++) {
8365
- if (i in self) {
8366
- result = fun.call(void 0, result, self[i], i, object);
8367
- }
8368
- }
8369
-
8370
- return result;
8371
- };
8372
- }
8373
- if (!Array.prototype.reduceRight) {
8374
- Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) {
8375
- var object = toObject(this),
8376
- self = splitString && _toString(this) == "[object String]" ?
8377
- this.split("") :
8378
- object,
8379
- length = self.length >>> 0;
8380
- if (_toString(fun) != "[object Function]") {
8381
- throw new TypeError(fun + " is not a function");
8382
- }
8383
- if (!length && arguments.length == 1) {
8384
- throw new TypeError("reduceRight of empty array with no initial value");
8385
- }
8386
-
8387
- var result, i = length - 1;
8388
- if (arguments.length >= 2) {
8389
- result = arguments[1];
8390
- } else {
8391
- do {
8392
- if (i in self) {
8393
- result = self[i--];
8394
- break;
8395
- }
8396
- if (--i < 0) {
8397
- throw new TypeError("reduceRight of empty array with no initial value");
8398
- }
8399
- } while (true);
8400
- }
8401
-
8402
- do {
8403
- if (i in this) {
8404
- result = fun.call(void 0, result, self[i], i, object);
8405
- }
8406
- } while (i--);
8407
-
8408
- return result;
8409
- };
8410
- }
8411
- if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) {
8412
- Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) {
8413
- var self = splitString && _toString(this) == "[object String]" ?
8414
- this.split("") :
8415
- toObject(this),
8416
- length = self.length >>> 0;
8417
-
8418
- if (!length) {
8419
- return -1;
8420
- }
8421
-
8422
- var i = 0;
8423
- if (arguments.length > 1) {
8424
- i = toInteger(arguments[1]);
8425
- }
8426
- i = i >= 0 ? i : Math.max(0, length + i);
8427
- for (; i < length; i++) {
8428
- if (i in self && self[i] === sought) {
8429
- return i;
8430
- }
8431
- }
8432
- return -1;
8433
- };
8434
- }
8435
- if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) {
8436
- Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) {
8437
- var self = splitString && _toString(this) == "[object String]" ?
8438
- this.split("") :
8439
- toObject(this),
8440
- length = self.length >>> 0;
8441
-
8442
- if (!length) {
8443
- return -1;
8444
- }
8445
- var i = length - 1;
8446
- if (arguments.length > 1) {
8447
- i = Math.min(i, toInteger(arguments[1]));
8448
- }
8449
- i = i >= 0 ? i : length - Math.abs(i);
8450
- for (; i >= 0; i--) {
8451
- if (i in self && sought === self[i]) {
8452
- return i;
8453
- }
8454
- }
8455
- return -1;
8456
- };
8457
- }
8458
- if (!Object.getPrototypeOf) {
8459
- Object.getPrototypeOf = function getPrototypeOf(object) {
8460
- return object.__proto__ || (
8461
- object.constructor ?
8462
- object.constructor.prototype :
8463
- prototypeOfObject
8464
- );
8465
- };
8466
- }
8467
- if (!Object.getOwnPropertyDescriptor) {
8468
- var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " +
8469
- "non-object: ";
8470
- Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) {
8471
- if ((typeof object != "object" && typeof object != "function") || object === null)
8472
- throw new TypeError(ERR_NON_OBJECT + object);
8473
- if (!owns(object, property))
8474
- return;
8475
-
8476
- var descriptor, getter, setter;
8477
- descriptor = { enumerable: true, configurable: true };
8478
- if (supportsAccessors) {
8479
- var prototype = object.__proto__;
8480
- object.__proto__ = prototypeOfObject;
8481
-
8482
- var getter = lookupGetter(object, property);
8483
- var setter = lookupSetter(object, property);
8484
- object.__proto__ = prototype;
8485
-
8486
- if (getter || setter) {
8487
- if (getter) descriptor.get = getter;
8488
- if (setter) descriptor.set = setter;
8489
- return descriptor;
8490
- }
8491
- }
8492
- descriptor.value = object[property];
8493
- return descriptor;
8494
- };
8495
- }
8496
- if (!Object.getOwnPropertyNames) {
8497
- Object.getOwnPropertyNames = function getOwnPropertyNames(object) {
8498
- return Object.keys(object);
8499
- };
8500
- }
8501
- if (!Object.create) {
8502
- var createEmpty;
8503
- if (Object.prototype.__proto__ === null) {
8504
- createEmpty = function () {
8505
- return { "__proto__": null };
8506
- };
8507
- } else {
8508
- createEmpty = function () {
8509
- var empty = {};
8510
- for (var i in empty)
8511
- empty[i] = null;
8512
- empty.constructor =
8513
- empty.hasOwnProperty =
8514
- empty.propertyIsEnumerable =
8515
- empty.isPrototypeOf =
8516
- empty.toLocaleString =
8517
- empty.toString =
8518
- empty.valueOf =
8519
- empty.__proto__ = null;
8520
- return empty;
8521
- }
8522
- }
8523
-
8524
- Object.create = function create(prototype, properties) {
8525
- var object;
8526
- if (prototype === null) {
8527
- object = createEmpty();
8528
- } else {
8529
- if (typeof prototype != "object")
8530
- throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'");
8531
- var Type = function () {};
8532
- Type.prototype = prototype;
8533
- object = new Type();
8534
- object.__proto__ = prototype;
8535
- }
8536
- if (properties !== void 0)
8537
- Object.defineProperties(object, properties);
8538
- return object;
8539
- };
8540
- }
8541
-
8542
- function doesDefinePropertyWork(object) {
8543
- try {
8544
- Object.defineProperty(object, "sentinel", {});
8545
- return "sentinel" in object;
8546
- } catch (exception) {
8547
- }
8548
- }
8549
- if (Object.defineProperty) {
8550
- var definePropertyWorksOnObject = doesDefinePropertyWork({});
8551
- var definePropertyWorksOnDom = typeof document == "undefined" ||
8552
- doesDefinePropertyWork(document.createElement("div"));
8553
- if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) {
8554
- var definePropertyFallback = Object.defineProperty;
8555
- }
8556
- }
8557
-
8558
- if (!Object.defineProperty || definePropertyFallback) {
8559
- var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: ";
8560
- var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: "
8561
- var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " +
8562
- "on this javascript engine";
8563
-
8564
- Object.defineProperty = function defineProperty(object, property, descriptor) {
8565
- if ((typeof object != "object" && typeof object != "function") || object === null)
8566
- throw new TypeError(ERR_NON_OBJECT_TARGET + object);
8567
- if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null)
8568
- throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor);
8569
- if (definePropertyFallback) {
8570
- try {
8571
- return definePropertyFallback.call(Object, object, property, descriptor);
8572
- } catch (exception) {
8573
- }
8574
- }
8575
- if (owns(descriptor, "value")) {
8576
-
8577
- if (supportsAccessors && (lookupGetter(object, property) ||
8578
- lookupSetter(object, property)))
8579
- {
8580
- var prototype = object.__proto__;
8581
- object.__proto__ = prototypeOfObject;
8582
- delete object[property];
8583
- object[property] = descriptor.value;
8584
- object.__proto__ = prototype;
8585
- } else {
8586
- object[property] = descriptor.value;
8587
- }
8588
- } else {
8589
- if (!supportsAccessors)
8590
- throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED);
8591
- if (owns(descriptor, "get"))
8592
- defineGetter(object, property, descriptor.get);
8593
- if (owns(descriptor, "set"))
8594
- defineSetter(object, property, descriptor.set);
8595
- }
8596
-
8597
- return object;
8598
- };
8599
- }
8600
- if (!Object.defineProperties) {
8601
- Object.defineProperties = function defineProperties(object, properties) {
8602
- for (var property in properties) {
8603
- if (owns(properties, property))
8604
- Object.defineProperty(object, property, properties[property]);
8605
- }
8606
- return object;
8607
- };
8608
- }
8609
- if (!Object.seal) {
8610
- Object.seal = function seal(object) {
8611
- return object;
8612
- };
8613
- }
8614
- if (!Object.freeze) {
8615
- Object.freeze = function freeze(object) {
8616
- return object;
8617
- };
8618
- }
8619
- try {
8620
- Object.freeze(function () {});
8621
- } catch (exception) {
8622
- Object.freeze = (function freeze(freezeObject) {
8623
- return function freeze(object) {
8624
- if (typeof object == "function") {
8625
- return object;
8626
- } else {
8627
- return freezeObject(object);
8628
- }
8629
- };
8630
- })(Object.freeze);
8631
- }
8632
- if (!Object.preventExtensions) {
8633
- Object.preventExtensions = function preventExtensions(object) {
8634
- return object;
8635
- };
8636
- }
8637
- if (!Object.isSealed) {
8638
- Object.isSealed = function isSealed(object) {
8639
- return false;
8640
- };
8641
- }
8642
- if (!Object.isFrozen) {
8643
- Object.isFrozen = function isFrozen(object) {
8644
- return false;
8645
- };
8646
- }
8647
- if (!Object.isExtensible) {
8648
- Object.isExtensible = function isExtensible(object) {
8649
- if (Object(object) === object) {
8650
- throw new TypeError(); // TODO message
8651
- }
8652
- var name = '';
8653
- while (owns(object, name)) {
8654
- name += '?';
8655
- }
8656
- object[name] = true;
8657
- var returnValue = owns(object, name);
8658
- delete object[name];
8659
- return returnValue;
8660
- };
8661
- }
8662
- if (!Object.keys) {
8663
- var hasDontEnumBug = true,
8664
- dontEnums = [
8665
- "toString",
8666
- "toLocaleString",
8667
- "valueOf",
8668
- "hasOwnProperty",
8669
- "isPrototypeOf",
8670
- "propertyIsEnumerable",
8671
- "constructor"
8672
- ],
8673
- dontEnumsLength = dontEnums.length;
8674
-
8675
- for (var key in {"toString": null}) {
8676
- hasDontEnumBug = false;
8677
- }
8678
-
8679
- Object.keys = function keys(object) {
8680
-
8681
- if (
8682
- (typeof object != "object" && typeof object != "function") ||
8683
- object === null
8684
- ) {
8685
- throw new TypeError("Object.keys called on a non-object");
8686
- }
8687
-
8688
- var keys = [];
8689
- for (var name in object) {
8690
- if (owns(object, name)) {
8691
- keys.push(name);
8692
- }
8693
- }
8694
-
8695
- if (hasDontEnumBug) {
8696
- for (var i = 0, ii = dontEnumsLength; i < ii; i++) {
8697
- var dontEnum = dontEnums[i];
8698
- if (owns(object, dontEnum)) {
8699
- keys.push(dontEnum);
8700
- }
8701
- }
8702
- }
8703
- return keys;
8704
- };
8705
-
8706
- }
8707
- if (!Date.now) {
8708
- Date.now = function now() {
8709
- return new Date().getTime();
8710
- };
8711
- }
8712
- var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003" +
8713
- "\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" +
8714
- "\u2029\uFEFF";
8715
- if (!String.prototype.trim) {
8716
- ws = "[" + ws + "]";
8717
- var trimBeginRegexp = new RegExp("^" + ws + ws + "*"),
8718
- trimEndRegexp = new RegExp(ws + ws + "*$");
8719
- String.prototype.trim = function trim() {
8720
- return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, "");
8721
- };
8722
- }
8723
-
8724
- function toInteger(n) {
8725
- n = +n;
8726
- if (n !== n) { // isNaN
8727
- n = 0;
8728
- } else if (n !== 0 && n !== (1/0) && n !== -(1/0)) {
8729
- n = (n > 0 || -1) * Math.floor(Math.abs(n));
8730
- }
8731
- return n;
8732
- }
8733
-
8734
- function isPrimitive(input) {
8735
- var type = typeof input;
8736
- return (
8737
- input === null ||
8738
- type === "undefined" ||
8739
- type === "boolean" ||
8740
- type === "number" ||
8741
- type === "string"
8742
- );
8743
- }
8744
-
8745
- function toPrimitive(input) {
8746
- var val, valueOf, toString;
8747
- if (isPrimitive(input)) {
8748
- return input;
8749
- }
8750
- valueOf = input.valueOf;
8751
- if (typeof valueOf === "function") {
8752
- val = valueOf.call(input);
8753
- if (isPrimitive(val)) {
8754
- return val;
8755
- }
8756
- }
8757
- toString = input.toString;
8758
- if (typeof toString === "function") {
8759
- val = toString.call(input);
8760
- if (isPrimitive(val)) {
8761
- return val;
8762
- }
8763
- }
8764
- throw new TypeError();
8765
- }
8766
- var toObject = function (o) {
8767
- if (o == null) { // this matches both null and undefined
8768
- throw new TypeError("can't convert "+o+" to object");
8769
- }
8770
- return Object(o);
8771
- };
8772
-
8773
- });