Bug 1108382 - Part 12: Do not use non-standard flag argument of String.prototype.replace in testing/web-platform/tests/. r=jgriffin
authorTooru Fujisawa <arai_a@mac.com>
Sun, 01 Mar 2015 09:51:33 +0900
changeset 249531 c65ef0c02ed3bf4071a76f901ab991f999662d71
parent 249530 36d46ffdc3a09263642f3ecd26164918ab665844
child 249532 60a37ae57d9ccbb6d8a26a469128889f3f692b0c
push id7860
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:46:02 +0000
treeherdermozilla-aurora@8ac636cd51f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs1108382
milestone39.0a1
Bug 1108382 - Part 12: Do not use non-standard flag argument of String.prototype.replace in testing/web-platform/tests/. r=jgriffin
testing/web-platform/tests/ambient-light/idlharness.html
testing/web-platform/tests/proximity/idlharness.html
--- a/testing/web-platform/tests/ambient-light/idlharness.html
+++ b/testing/web-platform/tests/ambient-light/idlharness.html
@@ -40,17 +40,17 @@ interface DeviceLightEvent : Event {
 };
 </pre>
 
 <script>
 (function() {
   "use strict";
   var idl_array = new IdlArray();
   // replace 'EventHandler' and 'unrestricted double' unrecognised by idlharness.js
-  var idls = document.getElementById('idl').textContent.replace('EventHandler', 'Function?', 'g').replace('unrestricted double', 'double', 'g');
+  var idls = document.getElementById('idl').textContent.replace(/EventHandler/g, 'Function?').replace(/unrestricted double/g, 'double');
 
   idl_array.add_untested_idls(document.getElementById('untested_idl').textContent);
   idl_array.add_idls(idls);
 
   idl_array.add_objects({
     Window: ['window'],
     DeviceLightEvent: ['new DeviceLightEvent("foo")']
   });
--- a/testing/web-platform/tests/proximity/idlharness.html
+++ b/testing/web-platform/tests/proximity/idlharness.html
@@ -54,17 +54,17 @@ interface UserProximityEvent : Event {
 };
 </pre>
 
 <script>
 (function() {
   "use strict";
   var idl_array = new IdlArray();
   // replace 'EventHandler' and 'unrestricted double' unrecognised by idlharness.js
-  var idls = document.getElementById('idl').textContent.replace('EventHandler', 'Function?', 'g').replace('unrestricted double', 'double', 'g');
+  var idls = document.getElementById('idl').textContent.replace(/EventHandler/g, 'Function?').replace(/unrestricted double/g, 'double');
 
   idl_array.add_untested_idls(document.getElementById('untested_idl').textContent);
   idl_array.add_idls(idls);
 
   idl_array.add_objects({
     Window: ['window'],
     DeviceProximityEvent: ['new DeviceProximityEvent("foo")'],
     UserProximityEvent: ['new UserProximityEvent("foo")']