浏览代码

Merge pull request #1005 from j-f1/fix-css-supports-check

Don’t throw when the `CSS` global is not defined
Jasper van Merle 6 年之前
父节点
当前提交
377fce4772
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      assets/javascripts/app/app.coffee

+ 1 - 1
assets/javascripts/app/app.coffee

@@ -254,7 +254,7 @@
         matchMedia:         !!window.matchMedia
         matchMedia:         !!window.matchMedia
         insertAdjacentHTML: !!document.body.insertAdjacentHTML
         insertAdjacentHTML: !!document.body.insertAdjacentHTML
         defaultPrevented:     document.createEvent('CustomEvent').defaultPrevented is false
         defaultPrevented:     document.createEvent('CustomEvent').defaultPrevented is false
-        cssVariables:         CSS.supports and CSS.supports('(--t: 0)')
+        cssVariables:       !!CSS?.supports?('(--t: 0)')
 
 
       for key, value of features when not value
       for key, value of features when not value
         Raven.captureMessage "unsupported/#{key}", level: 'info'
         Raven.captureMessage "unsupported/#{key}", level: 'info'