mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
make some async generator errors clearer
This commit is contained in:
parent
73312c9b8e
commit
37dd2c0856
@ -96,14 +96,14 @@ Generator.prototype = {
|
||||
get _object() { return this.__object; },
|
||||
set _object(value) {
|
||||
if (typeof value != "object")
|
||||
throw "expected type 'object', got type '" + typeof(value) + "'";
|
||||
throw "Generator: expected type 'object', got type '" + typeof(value) + "'";
|
||||
this.__object = value;
|
||||
},
|
||||
|
||||
get _method() { return this.__method; },
|
||||
set _method(value) {
|
||||
if (typeof value != "function")
|
||||
throw "expected type 'function', got type '" + typeof(value) + "'";
|
||||
throw "Generator: expected type 'function', got type '" + typeof(value) + "'";
|
||||
this.__method = value;
|
||||
},
|
||||
|
||||
@ -116,7 +116,7 @@ Generator.prototype = {
|
||||
},
|
||||
set onComplete(value) {
|
||||
if (value && typeof value != "function")
|
||||
throw "expected type 'function', got type '" + typeof(value) + "'";
|
||||
throw "Generator: expected type 'function', got type '" + typeof(value) + "'";
|
||||
this._onComplete = value;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user