https://github.com/web-platform-tests/wpt
Raw File
Tip revision: bfcd8e9d5a96b85c544123e76ba6c9131aedab9d authored by Darren Shen on 26 March 2018, 01:54:20 UTC
[css-typed-om] Support font properties.
Tip revision: bfcd8e9
console-count-label-conversion.any.js
"use strict";
// https://console.spec.whatwg.org/#count

test(() => {
  let countLabelToStringCalled = false;

  console.count({
    toString() {
      countLabelToStringCalled = true;
    }
  });

  assert_true(countLabelToStringCalled, "toString() must be called on count()'s label when label is an object");
}, "console.count()'s label gets converted to string via label.toString() when label is an object");

test(() => {
  assert_throws({name: "Error"}, () => {
    console.count({
      toString() {
        throw new Error("conversion error");
      }
    });
  }, "count() must re-throw any exceptions thrown by label.toString() conversion");
}, "console.count() throws exceptions generated by erroneous label.toString() conversion");
back to top