1 | "use strict";
|
2 | var __extends = (this && this.__extends) || (function () {
|
3 | var extendStatics = function (d, b) {
|
4 | extendStatics = Object.setPrototypeOf ||
|
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
7 | return extendStatics(d, b);
|
8 | };
|
9 | return function (d, b) {
|
10 | extendStatics(d, b);
|
11 | function __() { this.constructor = d; }
|
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
13 | };
|
14 | })();
|
15 | Object.defineProperty(exports, "__esModule", { value: true });
|
16 | var CucumberExpressionError = (function (_super) {
|
17 | __extends(CucumberExpressionError, _super);
|
18 | function CucumberExpressionError() {
|
19 | return _super !== null && _super.apply(this, arguments) || this;
|
20 | }
|
21 | return CucumberExpressionError;
|
22 | }(Error));
|
23 | exports.CucumberExpressionError = CucumberExpressionError;
|
24 | var AmbiguousParameterTypeError = (function (_super) {
|
25 | __extends(AmbiguousParameterTypeError, _super);
|
26 | function AmbiguousParameterTypeError() {
|
27 | return _super !== null && _super.apply(this, arguments) || this;
|
28 | }
|
29 | AmbiguousParameterTypeError.forConstructor = function (keyName, keyValue, parameterTypes, generatedExpressions) {
|
30 | return new this("parameter type with " + keyName + "=" + keyValue + " is used by several parameter types: " + parameterTypes + ", " + generatedExpressions);
|
31 | };
|
32 | AmbiguousParameterTypeError.forRegExp = function (parameterTypeRegexp, expressionRegexp, parameterTypes, generatedExpressions) {
|
33 | return new this("Your Regular Expression " + expressionRegexp + "\nmatches multiple parameter types with regexp " + parameterTypeRegexp + ":\n " + this._parameterTypeNames(parameterTypes) + "\n\nI couldn't decide which one to use. You have two options:\n\n1) Use a Cucumber Expression instead of a Regular Expression. Try one of these:\n " + this._expressions(generatedExpressions) + "\n\n2) Make one of the parameter types preferential and continue to use a Regular Expression.\n");
|
34 | };
|
35 | AmbiguousParameterTypeError._parameterTypeNames = function (parameterTypes) {
|
36 | return parameterTypes.map(function (p) { return "{" + p.name + "}"; }).join('\n ');
|
37 | };
|
38 | AmbiguousParameterTypeError._expressions = function (generatedExpressions) {
|
39 | return generatedExpressions.map(function (e) { return e.source; }).join('\n ');
|
40 | };
|
41 | return AmbiguousParameterTypeError;
|
42 | }(CucumberExpressionError));
|
43 | exports.AmbiguousParameterTypeError = AmbiguousParameterTypeError;
|
44 | var UndefinedParameterTypeError = (function (_super) {
|
45 | __extends(UndefinedParameterTypeError, _super);
|
46 | function UndefinedParameterTypeError(typeName) {
|
47 | return _super.call(this, "Undefined parameter type {" + typeName + "}") || this;
|
48 | }
|
49 | return UndefinedParameterTypeError;
|
50 | }(CucumberExpressionError));
|
51 | exports.UndefinedParameterTypeError = UndefinedParameterTypeError;
|
52 |
|
\ | No newline at end of file |