All new
alle new
This commit is contained in:
1 parent
da64472251
commit
5b20adee48
1605 files changed
+396517
-1674
No files matched your search
+22
@@ -0,0 +1,22 @@
|
||||
exports.error = function(options) {
|
||||
return new Error(options);
|
||||
};
|
||||
|
||||
var Error = function(options) {
|
||||
this.expected = options.expected;
|
||||
this.actual = options.actual;
|
||||
this._location = options.location;
|
||||
};
|
||||
|
||||
Error.prototype.describe = function() {
|
||||
var locationDescription = this._location ? this._location.describe() + ":\n" : "";
|
||||
return locationDescription + "Expected " + this.expected + "\nbut got " + this.actual;
|
||||
};
|
||||
|
||||
Error.prototype.lineNumber = function() {
|
||||
return this._location.lineNumber();
|
||||
};
|
||||
|
||||
Error.prototype.characterNumber = function() {
|
||||
return this._location.characterNumber();
|
||||
};
|
||||
Reference in new issue
Block a user