Bug 1313490 - Part 3: Remove expression closure from dom/. r=mrbkap
authorTooru Fujisawa <arai_a@mac.com>
Sat, 26 Nov 2016 06:41:43 +0900
changeset 324324 349bfd47d48b4af6eb1b8d8e1485d928e65606aa
parent 324323 64a9c8f9d503f56b914566f6943cf084381e96fe
child 324325 ce6bd69e09fb1927631d5a4aa0b66913e17a90a2
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersmrbkap
bugs1313490
milestone53.0a1
Bug 1313490 - Part 3: Remove expression closure from dom/. r=mrbkap
dom/workers/test/sharedWorker_sharedWorker.js
dom/workers/test/test_sharedWorker.html
--- a/dom/workers/test/sharedWorker_sharedWorker.js
+++ b/dom/workers/test/sharedWorker_sharedWorker.js
@@ -67,20 +67,19 @@ onconnect = function(event) {
   }
   if (!(event.ports[0] == event.source)) {
     throw new Error("'connect' event source property is incorrect!");
   }
   if (event.data) {
     throw new Error("'connect' event has data: " + event.data);
   }
 
-  // The expression closures should trigger a warning in debug builds, but NOT
-  // fire error events at us. If we ever actually remove expression closures
-  // (in bug 1083458), we'll need something else to test this case.
-  (function() "Expected console warning: expression closures are deprecated");
+  // Statement after return should trigger a warning, but NOT fire error events
+  // at us.
+  (function() { return; 1; });
 
   event.ports[0].onmessage = function(event) {
     if (!(event instanceof MessageEvent)) {
       throw new Error("'message' event is not a MessageEvent!");
     }
     if (!("ports" in event)) {
       throw new Error("'message' event doesn't have a 'ports' property!");
     }
--- a/dom/workers/test/test_sharedWorker.html
+++ b/dom/workers/test/test_sharedWorker.html
@@ -17,17 +17,17 @@
       <script class="testbody">
         "use strict";
 
         const href = window.location.href;
         const filename = "sharedWorker_sharedWorker.js";
         const sentMessage = "ping";
         const errorFilename = href.substring(0, href.lastIndexOf("/") + 1) +
                               filename;
-        const errorLine = 91;
+        const errorLine = 90;
         const errorColumn = 0;
 
         var worker = new SharedWorker(filename);
 
         ok(worker instanceof SharedWorker, "Got SharedWorker instance");
         ok(!("postMessage" in worker), "SharedWorker has no 'postMessage'");
         ok(worker.port instanceof MessagePort,
           "Shared worker has MessagePort");