(that, context)
| 921 | }; |
| 922 | |
| 923 | function addContext(that, context) { |
| 924 | if (that._context) { |
| 925 | var curContext = that._context; |
| 926 | |
| 927 | while (curContext.prevContext != null) { |
| 928 | curContext = curContext.prevContext; |
| 929 | } |
| 930 | |
| 931 | if (curContext.prevContext === null) { |
| 932 | curContext.prevContext = context; |
| 933 | // just update the prevContext but don't change the curContext. |
| 934 | return that; |
| 935 | } else if (context.prevContext == null) { |
| 936 | context.prevContext = that._context; |
| 937 | } else { |
| 938 | throw new Error("Illegal construction - use 'or' to combine checks"); |
| 939 | } |
| 940 | } |
| 941 | return setContext(that, context); |
| 942 | } |
| 943 | |
| 944 | function setContext(that, context) { |
| 945 | that._contexts[that._contexts.length - 1] = context; |
no test coverage detected