summaryrefslogtreecommitdiff
path: root/resources/src/es5-skip.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/src/es5-skip.js')
-rw-r--r--resources/src/es5-skip.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/resources/src/es5-skip.js b/resources/src/es5-skip.js
new file mode 100644
index 00000000..a4039d89
--- /dev/null
+++ b/resources/src/es5-skip.js
@@ -0,0 +1,18 @@
+/*!
+ * Skip function for es5-shim module.
+ *
+ * Test for strict mode as a proxy for full ES5 function support (but not syntax)
+ * Per http://kangax.github.io/compat-table/es5/ this is a reasonable shortcut
+ * that still allows this to be as short as possible (there are no browsers we
+ * support that have strict mode, but lack other features).
+ *
+ * Do explicitly test for Function#bind because of PhantomJS (which implements
+ * strict mode, but lacks Function#bind).
+ *
+ * IE9 supports all features except strict mode, so loading es5-shim should be close to
+ * a no-op but does increase page payload).
+ */
+return ( function () {
+ 'use strict';
+ return !this && !!Function.prototype.bind;
+}() );