Граф коммитов

2 Коммитов

Автор SHA1 Сообщение Дата
Andreas Tolfsen de884b68a6 Bug 1326534 - Exclude array and null from being counted as objects; r=automatedtester
Calling `typeof` on arrays or null in JavaScript returns `"object"`,
and a safer check is to rely on `Object.prototype.toString`.

MozReview-Commit-ID: 5VxXf2ByoEx

--HG--
extra : rebase_source : 4d1fe95a75343964836e670d0ceffa6ce680e390
2016-12-30 11:21:27 +00:00
Andreas Tolfsen e5010028a2 Bug 1313865 - Centralise common Marionette assertions; r=automatedtester,maja_zf
Many tests that result in throwing errors, amongst those many type-
and platform checks, are repeated throughout the Marionette code base.
This patch centralises the most common of these, typically reducing
consumer calls from three to one line.

Example usage:

	assert.defined(cmd.parameters.value);
	assert.postiveInteger(cmd.parameters.value,
	    error.pprint`Expected 'value' (${value}) to be a signed integer`);
	// InvalidArgumentError: Expected 'value' ([object Object] {"foo": "bar"}) to be a positive integer

MozReview-Commit-ID: BHOaDazeGer

--HG--
extra : rebase_source : 1d35c10e29d4fd536829e9714ae65bcd14ad21f8
2016-10-31 22:00:21 +00:00