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.
This commit is contained in:
parent
8341579fd3
commit
a17b13019b
8
pdf.js
8
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);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user