tw_getExtraOfLastInvocation method

String? tw_getExtraOfLastInvocation([
  1. String? key
])

Retrieve the extra text that was provided to tw_logInvocation in the last invocation that was recorded with key. If key is null - return the extra of the last invocation of any key.

Implementation

String? tw_getExtraOfLastInvocation([ String? key ]) {
	if (!this.tw_wasInvoked(key: key)) {
		return null;
	}

	if (key == null) {
		if (this._mapInvocations.values.length != 1) {
			throw "there were multiple invocations since last clear; a key must be supplied";
		}

		return this._mapInvocations.values.first.last.extra;
	}

	return this._mapInvocations[key]!.last.extra;
}