[Pkg-javascript-commits] [sockjs-client] 214/434: Issue #29 cosmetic: 'Lookup' is a better name

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit a571c94e051de7af489b4fc541194956e1d171fe
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Fri Nov 25 17:00:19 2011 +0000

    Issue #29 cosmetic: 'Lookup' is a better name
---
 lib/utils.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/utils.js b/lib/utils.js
index a1663cf..79affc3 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -358,7 +358,7 @@ utils.delay = function(t, fun) {
 // Chars worth escaping, as defined by Douglas Crockford:
 //   https://github.com/douglascrockford/JSON-js/blob/47a9882cddeb1e8529e07af9736218075372b8ac/json2.js#L196
 var json_escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-    json_unrolled_meta = {
+    json_lookup = {
 "\u0000":"\\u0000","\u0001":"\\u0001","\u0002":"\\u0002","\u0003":"\\u0003",
 "\u0004":"\\u0004","\u0005":"\\u0005","\u0006":"\\u0006","\u0007":"\\u0007",
 "\b":"\\b","\t":"\\t","\n":"\\n","\u000b":"\\u000b","\f":"\\f","\r":"\\r",
@@ -393,14 +393,14 @@ var json_escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17
 // Some extra characters that Chrome gets wrong, and substitutes with
 // something else on the wire.
 var extra_escapable = /[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0 [...]
-    extra_unrolled_meta;
+    extra_lookup;
 
 // JSON Quote string. Use native implementation when possible.
 var JSONQuote = (JSON && JSON.stringify) || function(string) {
     json_escapable.lastIndex = 0;
     if (json_escapable.test(string)) {
         string = string.replace(json_escapable, function(a) {
-            return json_unrolled_meta[a];
+            return json_lookup[a];
         });
     }
     return '"' + string + '"';
@@ -408,7 +408,7 @@ var JSONQuote = (JSON && JSON.stringify) || function(string) {
 
 // This may be quite slow, so let's delay until user actually uses bad
 // characters.
-var unroll_meta = function(escapable) {
+var unroll_lookup = function(escapable) {
     var i;
     var unrolled = {}
     var c = []
@@ -436,10 +436,10 @@ utils.quote = function(string) {
         return quoted;
     }
 
-    if(!extra_unrolled_meta) extra_unrolled_meta = unroll_meta(extra_escapable);
+    if(!extra_lookup) extra_lookup = unroll_lookup(extra_escapable);
 
     return quoted.replace(extra_escapable, function(a) {
-        return extra_unrolled_meta[a];
+        return extra_lookup[a];
     });
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list