1
0
forked from GitHub/gf-core

Syntax editor: improvements and fixes with grammar manager

This commit is contained in:
john.j.camilleri
2012-11-27 10:09:40 +00:00
parent 6542f6ffdd
commit 054df2451a
8 changed files with 65 additions and 80 deletions

View File

@@ -22,12 +22,21 @@ if(!Array.isArray) {
// Create a clone of an array
// http://davidwalsh.name/javascript-clone-array
// Note that iterating over an array with for...in will include "clone" as a key!
// if(!Array.clone) {
// Array.prototype.clone = function() {
// return this.slice(0);
// };
// }
if(!Array.clone) {
Array.clone = function(arg) {
return arg.slice(0);
};
}
// Array Remove - By John Resig (MIT Licensed)
// http://ejohn.org/blog/javascript-array-remove/if(!Array.remove) {
if(!Array.remove) {
Array.remove = function(arg, from, to) {
var rest = arg.slice((to || from) + 1 || arg.length);
arg.length = from < 0 ? arg.length + from : from;
return arg.push.apply(arg, rest);
};
}
/* --- JSONP ---------------------------------------------------------------- */