Re: [w3c/manifest] WIP: beforeinstallprompt (#506)

kenchris commented on this pull request.



> +   *
+   */
+  class BeforeInstallPromptEvent extends Event {
+
+    constructor(typeArg, eventInit) {
+      // WebIDL Guard. Not in spec, as it's all handled by WebIDL.
+      if (arguments.length === 0) {
+        throw new TypeError("Not enough arguments. Expected at least 1.");
+      }
+      const initType = typeof eventInit;
+      if (arguments.length === 2 && initType !== "undefined" && initType !== "object") {
+        throw new TypeError("Value can't be converted to a dictionary.");
+      }
+      super(typeArg, Object.assign({ cancelable: true }, eventInit));
+
+      if (eventInit && typeof eventInit.userChoice !== "undefined" && !AppBannerPromptOutcome.has(String(eventInit.userChoice))) {

I would move the !AppBanner... outside and into a variable

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/pull/506

Received on Monday, 24 October 2016 11:22:50 UTC