[Pkg-javascript-commits] [json-js] 49/85: Defense against window.prototype
Jonas Smedegaard
dr at jones.dk
Mon Mar 14 10:39:31 UTC 2016
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository json-js.
commit 43d7836c8ec9b31a02a31ae0c400bdae04d3650d
Author: Douglas Crockford <douglas at crockford.com>
Date: Mon Oct 8 14:40:29 2012 -0700
Defense against window.prototype
---
json.js | 5 ++---
json2.js | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/json.js b/json.js
old mode 100755
new mode 100644
index 1c2b253..9a338bf
--- a/json.js
+++ b/json.js
@@ -1,6 +1,6 @@
/*
json.js
- 2011-08-30
+ 2012-10-08
Public Domain
@@ -196,8 +196,7 @@
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
-var JSON;
-if (!JSON) {
+if (typeof JSON !== 'object') {
JSON = {};
}
diff --git a/json2.js b/json2.js
index 3b0c872..c7745df 100644
--- a/json2.js
+++ b/json2.js
@@ -1,6 +1,6 @@
/*
json2.js
- 2011-10-19
+ 2012-10-08
Public Domain.
@@ -159,8 +159,7 @@
// Create a JSON object only if one does not already exist. We create the
// methods in a closure to avoid creating global variables.
-var JSON;
-if (!JSON) {
+if (typeof JSON !== 'object') {
JSON = {};
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/json-js.git
More information about the Pkg-javascript-commits
mailing list