Skip to content

Commit

Permalink
Layers: Scoring Algorithm (#12958)
Browse files Browse the repository at this point in the history
* Add comments for future todos

* Ensure size/position is always re-measured

* scoring

* Fix fixed-position undeclare layer

* Ensure a remeasure happens

* Fix cache and score

* Fix width/height calc

* Add force remeasurement

More information is necessary from the caller to determine whether it
should be forced.

* Lint

* Review comments

* Review comments

* Fix renames
  • Loading branch information
jridgewell committed Jan 30, 2018
1 parent 13042d4 commit 578f708
Show file tree
Hide file tree
Showing 6 changed files with 380 additions and 67 deletions.
15 changes: 15 additions & 0 deletions src/log.js
Expand Up @@ -379,6 +379,21 @@ export class Log {
return /** @type {number} */ (shouldBeNumber);
}

/**
* Throws an error if the first argument isn't a boolean.
*
* For more details see `assert`.
*
* @param {*} shouldBeBoolean
* @param {string=} opt_message The assertion message
* @return {boolean} The boolean value.
*/
assertBoolean(shouldBeBoolean, opt_message) {
this.assert(!!shouldBeBoolean === shouldBeBoolean,
(opt_message || 'Boolean expected') + ': %s', shouldBeBoolean);
return /** @type {boolean} */ (shouldBeBoolean);
}

/**
* Asserts and returns the enum value. If the enum doesn't contain such a value,
* the error is thrown.
Expand Down

0 comments on commit 578f708

Please sign in to comment.