make some async generator errors clearer

This commit is contained in:
Dan Mills 2008-05-30 17:38:27 -07:00
parent 73312c9b8e
commit 37dd2c0856

View File

@ -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;
},