lib/utils/escape.js
function(escapable) {
  var i;
  var unrolled = {};
  var c = [];
  for (i = 0; i < 65536; i++) {
    c.push( String.fromCharCode(i) );
  }
  escapable.lastIndex = 0;
  c.join('').replace(escapable, function(a) {
    unrolled[ a ] = '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
    return '';
  });
  escapable.lastIndex = 0;
  return unrolled;
}
function(escapable) {
  var i;
  var unrolled = {};
  var c = [];
  for (i = 0; i < 65536; i++) {
    c.push( String.fromCharCode(i) );
  }
  escapable.lastIndex = 0;
  c.join('').replace(escapable, function(a) {
    unrolled[ a ] = '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
    return '';
  });
  escapable.lastIndex = 0;
  return unrolled;
}
function ( escapable ) { var i ; var unrolled = { } ; var c = [ ] ; for ( i = 0 ; i < 65536 ; i ++ ) { c . push ( String . fromCharCode ( i ) ) ; } escapable . lastIndex = 0 ; c . join ( '' ) . replace ( escapable , function ( a ) { unrolled [ a ] = '\\u' + ( '0000' + a . charCodeAt ( 0 ) . toString ( 16 ) ) . slice ( - 4 ) ; return '' ; } ) ; escapable . lastIndex = 0 ; return unrolled ; }
This may be quite slow, so let's delay until user actually uses bad characters.
This may be quite slow so let s delay until user actually uses bad characters .