summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorJohn J. Camilleri <john@digitalgrammars.com>2019-06-12 09:51:27 +0200
committerJohn J. Camilleri <john@digitalgrammars.com>2019-06-12 09:51:27 +0200
commit18d0e1fad0c1a29082c1b90c7d7dbb11c6440275 (patch)
tree2e951fdf1b1a7742e62931ab1315a5c72c851e5b /src/runtime
parentab94e93b94bbc6d1cb51043fdedc9b4cc57d4b48 (diff)
gflb.ts: add comments about startsWith polyfill, making into module
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/typescript/gflib.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/runtime/typescript/gflib.ts b/src/runtime/typescript/gflib.ts
index cbba6a524..4d5a45cfd 100644
--- a/src/runtime/typescript/gflib.ts
+++ b/src/runtime/typescript/gflib.ts
@@ -1535,6 +1535,8 @@ function isUndefined(a: any): boolean {
// }
// }
+// A polyfill with provides the String.startsWith function for older targets
+// If you are targeting ES6(2015) or later, you don't need this
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith#Polyfill
// if (!String.prototype.startsWith) {
interface String {
@@ -1547,3 +1549,22 @@ Object.defineProperty(String.prototype, 'startsWith', {
}
})
// }
+
+// If you want to make this into a proper module, uncomment this:
+// export {
+// GFGrammar,
+// GFAbstract,
+// GFConcrete,
+// Fun,
+// Type,
+// Apply,
+// Coerce,
+// PArg,
+// Const,
+// CncFun,
+// SymCat,
+// SymKS,
+// SymKP,
+// SymLit,
+// Alt,
+// }