From 0f41610032eeddbef40fba6c2bfdcd26bce38de0 Mon Sep 17 00:00:00 2001 From: Patrick Kettner Date: Mon, 1 Dec 2014 22:27:35 -0500 Subject: [PATCH] add templatestrings detect --- feature-detects/templatestrings.js | 25 ++++++++++++++++++ lib/config-all.json | 41 +++++++++++++++--------------- 2 files changed, 46 insertions(+), 20 deletions(-) create mode 100644 feature-detects/templatestrings.js diff --git a/feature-detects/templatestrings.js b/feature-detects/templatestrings.js new file mode 100644 index 0000000000..07f89f6fc9 --- /dev/null +++ b/feature-detects/templatestrings.js @@ -0,0 +1,25 @@ +/*! +{ + "name": "Template strings", + "property": "templatestrings", + "notes": [{ + "name": "MDN Reference", + "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings#Browser_compatibility" + }] +} +!*/ +/* DOC +Template strings are string literals allowing embedded expressions. +*/ +define(['Modernizr'], function(Modernizr) { + Modernizr.addTest('templatestrings', function() { + var supports; + try { + // A number of tools, including uglifyjs and require, break on a raw "`", so + // use an eval to get around that. + eval('``'); + supports = true; + } catch (e) {} + return !!supports; + }); +}); diff --git a/lib/config-all.json b/lib/config-all.json index 7dd104b235..45b497191d 100644 --- a/lib/config-all.json +++ b/lib/config-all.json @@ -13,15 +13,15 @@ "feature-detects": [ "test/a/download", "test/applicationcache", + "test/audio", "test/audio/loop", "test/audio/preload", "test/audio/webaudio", - "test/audio", - "test/battery/lowbattery", "test/battery", + "test/battery/lowbattery", "test/blob", - "test/canvas/todataurl", "test/canvas", + "test/canvas/todataurl", "test/canvastext", "test/contenteditable", "test/contextmenu", @@ -42,8 +42,8 @@ "test/css/boxshadow", "test/css/boxsizing", "test/css/calc", - "test/css/chunit", "test/css/checked", + "test/css/chunit", "test/css/columns", "test/css/cubicbezierrange", "test/css/displayrunin", @@ -84,8 +84,8 @@ "test/css/subpixelfont", "test/css/supports", "test/css/target", - "test/css/textshadow", "test/css/textalignlast", + "test/css/textshadow", "test/css/transforms", "test/css/transforms3d", "test/css/transformstylepreserve3d", @@ -104,11 +104,10 @@ "test/dom/createElement-attrs", "test/dom/dataset", "test/dom/documentfragment", - "test/dom/microdata", "test/dom/hidden", + "test/dom/microdata", "test/dom/mutationObserver", "test/draganddrop", - "test/elem/unknown", "test/elem/datalist", "test/elem/details", "test/elem/output", @@ -118,24 +117,25 @@ "test/elem/template", "test/elem/time", "test/elem/track", + "test/elem/unknown", "test/emoji", "test/es5/array", "test/es5/date", "test/es5/function", "test/es5/object", + "test/es5/specification", "test/es5/strictmode", "test/es5/string", + "test/es5/syntax", + "test/es5/undefined", "test/es6/array", + "test/es6/contains", + "test/es6/generators", "test/es6/math", "test/es6/number", "test/es6/object", - "test/es6/string", - "test/es5/syntax", - "test/es5/undefined", - "test/es5/specification", - "test/es6/contains", "test/es6/promises", - "test/es6/generators", + "test/es6/string", "test/event/deviceorientation-motion", "test/event/oninput", "test/eventlistener", @@ -179,12 +179,12 @@ "test/network/beacon", "test/network/connection", "test/network/eventsource", + "test/network/xhr-responsetype", "test/network/xhr-responsetype-arraybuffer", "test/network/xhr-responsetype-blob", "test/network/xhr-responsetype-document", "test/network/xhr-responsetype-json", "test/network/xhr-responsetype-text", - "test/network/xhr-responsetype", "test/network/xhr2", "test/notification", "test/pagevisibility-api", @@ -204,13 +204,14 @@ "test/storage/sessionstorage", "test/storage/websqldatabase", "test/style/scoped", + "test/svg", "test/svg/asimg", "test/svg/clippaths", "test/svg/filters", - "test/svg/inline", "test/svg/foreignobject", + "test/svg/inline", "test/svg/smil", - "test/svg", + "test/templatestrings", "test/textarea/maxlength", "test/touchevents", "test/typed-arrays", @@ -221,19 +222,19 @@ "test/url/parser", "test/userdata", "test/vibration", + "test/video", "test/video/autoplay", "test/video/loop", "test/video/preload", - "test/video", "test/vml", "test/web-intents", "test/webanimations", - "test/webgl/extensions", "test/webgl", + "test/webgl/extensions", "test/webrtc/getusermedia", "test/webrtc/peerconnection", - "test/websockets/binary", "test/websockets", + "test/websockets/binary", "test/window/framed", "test/workers/blobworkers", "test/workers/dataworkers", @@ -241,4 +242,4 @@ "test/workers/transferables", "test/workers/webworkers" ] -} +} \ No newline at end of file