From a17b13019b17f71a55c47e829dbbc59b815eb158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20G=2E=20Stan?= Date: Thu, 27 Oct 2011 02:47:18 +0300 Subject: [PATCH] Fix strict mode syntax error in Safari This happens in Safari 5.1 and Mobile Safari on iOS 5. Apparently, Safari considers the function name as part of the ECMA's FormalParameterList and applies the strict mode rules from section 13.1 of the specification. > It is a SyntaxError if any Identifier value occurs more than once > within a FormalParameterList of a strict mode > FunctionDeclaration or FunctionExpression. --- pdf.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pdf.js b/pdf.js index f45993210..05a21538d 100644 --- a/pdf.js +++ b/pdf.js @@ -7522,19 +7522,19 @@ var Promise = (function() { Promise.prototype = { hasData: false, - set data(data) { - if (data === undefined) { + set data(value) { + if (value === undefined) { return; } if (this._data !== EMPTY_PROMISE) { throw 'Promise ' + this.name + ': Cannot set the data of a promise twice'; } - this._data = data; + this._data = value; this.hasData = true; if (this.onDataCallback) { - this.onDataCallback(data); + this.onDataCallback(value); } },