<commit_before>goog.provide('ol.canvas');

goog.require('goog.dom');
goog.require('goog.dom.TagName');


/**
 * Is supported.
 * @const
 * @type {boolean}
 */
ol.canvas.SUPPORTED = (function() {
  if (!('HTMLCanvasElement' in goog.global)) {
    return false;
  }
  try {
    var canvas = /** @type {HTMLCanvasElement} */
        (goog.dom.createElement(goog.dom.TagName.CANVAS));
    return !goog.isNull(canvas.getContext('2d'));
  } catch (e) {
    return false;
  }
})();<commit_msg>Improve type checking in ol.canvas.SUPPORTED<commit_after>goog.provide('ol.canvas');

goog.require('goog.dom');
goog.require('goog.dom.TagName');


/**
 * Is supported.
 * @const
 * @type {boolean}
 */
ol.canvas.SUPPORTED = (
    /**
     * @return {boolean} Canvas supported.
     */
    function() {
      if (!('HTMLCanvasElement' in goog.global)) {
        return false;
      }
      try {
        var canvas = /** @type {HTMLCanvasElement} */
            (goog.dom.createElement(goog.dom.TagName.CANVAS));
        return !goog.isNull(canvas.getContext('2d'));
      } catch (e) {
        return false;
      }
    })();
{'fraction_non_alphanumeric': 0.1854185418541854, 'fraction_numerical': 0.0018001800180018, 'mean_word_length': 2.7823129251700682, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5770271', 'n_tokens_mistral': 387, 'n_tokens_neox': 367, 'n_words': 64}