From 4d0e9415c571ac4f4e908fb5df6a8187a812a506 Mon Sep 17 00:00:00 2001 From: Jaakko Puntila Date: Fri, 16 Oct 2015 15:16:31 +0300 Subject: [PATCH] Use Object.defineProperty instead of __defineGetter__ __defineGetter__ is non-standard and doesn't exist in IE<=10 --- index.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 7820e64..01103a1 100644 --- a/index.js +++ b/index.js @@ -543,13 +543,15 @@ var compile = function(schema, cache, root, reporter, opts) { validate = validate.toFunction(scope) validate.errors = null - validate.__defineGetter__('error', function() { - if (!validate.errors) return '' - return validate.errors - .map(function(err) { - return err.field+' '+err.message - }) - .join('\n') + Object.defineProperty(validate, 'error', { + get: function() { + if (!validate.errors) return '' + return validate.errors + .map(function(err) { + return err.field+' '+err.message + }) + .join('\n') + } }) validate.toJSON = function() {