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.
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);
}
},