Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Changed Object.keys to _.keys to support IE8 #36

Closed
wants to merge 1 commit into from

2 participants

@isamuelson

IE 8 does not support Object.keys.
This change requires underscore.js to be loaded into the browser

@pksunkara

Underscore.js is a lot to depend on for such a small fix.

Would appreciate if you could isolate the logic and include it in the revalidator.

@pksunkara pksunkara closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 7, 2012
  1. @isamuelson
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 3 deletions.
  1. +3 −3 lib/revalidator.js
  2. +3 −0  package.json
View
6 lib/revalidator.js
@@ -1,4 +1,4 @@
-(function (exports) {
+(function (exports, _) {
exports.validate = validate;
exports.mixin = mixin;
@@ -159,7 +159,7 @@
};
function validateObject(object, schema, options, errors) {
- var props, allProps = Object.keys(object),
+ var props, allProps = _.keys(object),
visitedProps = [];
// see 5.2
@@ -406,4 +406,4 @@
}
-})(typeof(window) === 'undefined' ? module.exports : (window.json = window.json || {}));
+})(typeof(window) === 'undefined' ? module.exports : (window.json = window.json || {}), typeof(window) === 'undefined' ? require('underscore') : _ );
View
3  package.json
@@ -11,6 +11,9 @@
"type": "git",
"url": "http://github.com/flatiron/revalidator.git"
},
+ "dependencies": {
+ "underscore": "1.4.3"
+ },
"devDependencies": {
"vows": "0.6.x"
},
Something went wrong with that request. Please try again.