Merge mozilla-central to fx-team
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 18 Dec 2013 16:13:04 +0100
changeset 161084 2e8fb54ac9ff0e95556e97d42f28df19ea88600f
parent 161083 ac1f669afa6f5a48983ea1702a25421458f493bd (current diff)
parent 161031 7ec385eb27f569bda8977d25dbf2ba21d6008b51 (diff)
child 161085 6fe9bf8ebd0b878593a620f5ab2aac3cd225e703
push id25867
push userryanvm@gmail.com
push dateThu, 19 Dec 2013 02:19:33 +0000
treeherdermozilla-central@04a70c8908de [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to fx-team
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,4 +1,4 @@
 {
-    "revision": "7412c36923b59f6e4d7076de5be7e6ded6ddc586", 
+    "revision": "444fa63091ea8641d08681f921631f8b7ddc0d88", 
     "repo_path": "/integration/gaia-central"
 }
--- a/content/base/test/mochitest.ini
+++ b/content/base/test/mochitest.ini
@@ -517,16 +517,17 @@ skip-if = toolkit == "gonk" # bug 945189
 [test_bug869006.html]
 [test_bug876282.html]
 [test_bug890580.html]
 [test_bug894874.html]
 [test_bug895239.html]
 [test_bug895974.html]
 [test_bug902847.html]
 [test_bug907892.html]
+[test_bug922681.html]
 [test_bug927196.html]
 [test_caretPositionFromPoint.html]
 [test_classList.html]
 [test_copypaste.html]
 [test_copypaste.xhtml]
 [test_createHTMLDocument.html]
 [test_declare_stylesheet_obsolete.html]
 [test_domparser_null_char.html]
new file mode 100644
--- /dev/null
+++ b/content/base/test/test_bug922681.html
@@ -0,0 +1,113 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=922681
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 922681</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript">
+  function testInnerHTMLParserInsertionMode() {
+
+    function testInnerHTML(el, input, output) {
+        el.innerHTML = input;
+        is(el.innerHTML, output, el.tagName.toLowerCase() + ': "' + input + '"');
+    }
+
+    var c;
+
+    c = document.createElement("html");
+    testInnerHTML(c, "", "<head></head><body></body>");
+    testInnerHTML(c, "xyz", "<head></head><body>xyz</body>");
+    testInnerHTML(c, "<input>", "<head></head><body><input></body>");
+
+    c = document.createElement("colgroup");
+    testInnerHTML(c, "abcdef", "");
+    testInnerHTML(c, "", "");
+    testInnerHTML(c, "\n", "\n");
+    testInnerHTML(c, "<col>", "<col>");
+
+    c = document.createElement("select");
+    testInnerHTML(c, "123", "123");
+    testInnerHTML(c, "<input>", "");
+    testInnerHTML(c, "\0", "");
+    testInnerHTML(c, "<col>", "");
+    testInnerHTML(c, "<option>", "<option></option>");
+
+    c = document.createElement("head");
+    testInnerHTML(c, "123", "123");
+    testInnerHTML(c, "\n", "\n");
+
+    c = document.createElement("frameset");
+    testInnerHTML(c, "456", "");
+    testInnerHTML(c, "\n", "\n");
+    testInnerHTML(c, "<input>", "");
+    testInnerHTML(c, "\0", "");
+
+    c = document.createElement("table");
+    testInnerHTML(c, "abc", "abc");
+    testInnerHTML(c, "<td>", "<tbody><tr><td></td></tr></tbody>");
+    testInnerHTML(c, "</body>", "");
+    testInnerHTML(c, "<input>", "<input>");
+
+    c = document.createElement("tr");
+    testInnerHTML(c, "xyz", "xyz");
+    testInnerHTML(c, "<td>", "<td></td>");
+    testInnerHTML(c, "</body>", "");
+    testInnerHTML(c, "<table>", "");
+
+    c = document.createElement("td");
+    testInnerHTML(c, "789", "789");
+    testInnerHTML(c, "\0", "");
+    testInnerHTML(c, "<td>", "");
+
+    c = document.createElement("th");
+    testInnerHTML(c, "789", "789");
+    testInnerHTML(c, "\0", "");
+    testInnerHTML(c, "</tr>", "");
+
+    c = document.createElement("caption");
+    testInnerHTML(c, "xyz", "xyz");
+    testInnerHTML(c, "\0", "");
+    testInnerHTML(c, "<td>", "");
+    testInnerHTML(c, "<dd>", "<dd></dd>");
+    testInnerHTML(c, "<body>", "");
+
+    function testTableBody(tag) {
+        var c = document.createElement(tag);
+        testInnerHTML(c, "abc", "abc");
+        testInnerHTML(c, "<td>", "<tr><td></td></tr>");
+        testInnerHTML(c, "</body>", "");
+        testInnerHTML(c, "<input>", "<input>");
+    }
+    testTableBody("thead");
+    testTableBody("tbody");
+    testTableBody("tfoot");
+
+    c = document.createElement("template");
+    testInnerHTML(c, "abc", "abc");
+    testInnerHTML(c, "<td>", "<td></td>");
+    testInnerHTML(c, "</template>", "");
+    testInnerHTML(c, "<input>", "<input>");
+
+    c = document.createElement("div");
+    testInnerHTML(c, "abc", "abc");
+    testInnerHTML(c, "<td>", "");
+    testInnerHTML(c, "</body>", "");
+    testInnerHTML(c, "<input>", "<input>");
+
+    SimpleTest.finish();
+  }
+
+  addLoadEvent(testInnerHTMLParserInsertionMode);
+  SimpleTest.waitForExplicitFinish();
+  </script>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=922681">Mozilla Bug 922681</a>
+<pre id="test">
+</pre>
+</body>
+</html>
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -430,37 +430,37 @@ public:
   nsPingListener(bool requireSameHost, nsIContent* content, nsILoadGroup* loadGroup)
     : mRequireSameHost(requireSameHost),
       mContent(content),
       mLoadGroup(loadGroup)
   {}
 
   ~nsPingListener();
 
-  NS_IMETHODIMP StartTimeout();
+  nsresult StartTimeout();
 
 private:
   bool mRequireSameHost;
   nsCOMPtr<nsIContent> mContent;
   nsCOMPtr<nsILoadGroup> mLoadGroup;
   nsCOMPtr<nsITimer> mTimer;
 };
 
 NS_IMPL_ISUPPORTS4(nsPingListener, nsIStreamListener, nsIRequestObserver,
                    nsIInterfaceRequestor, nsIChannelEventSink)
 
 nsPingListener::~nsPingListener()
 {
   if (mTimer) {
     mTimer->Cancel();
-    mTimer = 0;
+    mTimer = nullptr;
   }
 }
 
-NS_IMETHODIMP
+nsresult
 nsPingListener::StartTimeout()
 {
   nsCOMPtr<nsITimer> timer = do_CreateInstance(NS_TIMER_CONTRACTID);
 
   if (timer) {
     nsresult rv = timer->InitWithFuncCallback(OnPingTimeout, mLoadGroup,
                                               PING_TIMEOUT,
                                               nsITimer::TYPE_ONE_SHOT);
@@ -487,17 +487,23 @@ nsPingListener::OnDataAvailable(nsIReque
   uint32_t result;
   return stream->ReadSegments(NS_DiscardSegment, nullptr, count, &result);
 }
 
 NS_IMETHODIMP
 nsPingListener::OnStopRequest(nsIRequest *request, nsISupports *context,
                               nsresult status)
 {
-  mLoadGroup = 0;
+  mLoadGroup = nullptr;
+
+  if (mTimer) {
+    mTimer->Cancel();
+    mTimer = nullptr;
+  }
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPingListener::GetInterface(const nsIID &iid, void **result)
 {
   if (iid.Equals(NS_GET_IID(nsIChannelEventSink))) {
     NS_ADDREF_THIS();
@@ -651,18 +657,17 @@ SendPing(void *closure, nsIContent *cont
   // Construct a listener that merely discards any response.  If successful at
   // opening the channel, then it is not necessary to hold a reference to the
   // channel.  The networking subsystem will take care of that for us.
   nsPingListener *pingListener =
       new nsPingListener(info->requireSameHost, content, loadGroup);
   if (!pingListener)
     return;
 
-  nsCOMPtr<nsIStreamListener> listener =
-    static_cast<nsIStreamListener*>(pingListener);
+  nsCOMPtr<nsIStreamListener> listener(pingListener);
 
   // Observe redirects as well:
   nsCOMPtr<nsIInterfaceRequestor> callbacks = do_QueryInterface(listener);
   NS_ASSERTION(callbacks, "oops");
   loadGroup->SetNotificationCallbacks(callbacks);
 
   chan->AsyncOpen(listener, nullptr);
 
--- a/dom/bluetooth/BluetoothAdapter.cpp
+++ b/dom/bluetooth/BluetoothAdapter.cpp
@@ -310,21 +310,23 @@ BluetoothAdapter::Notify(const Bluetooth
     NS_NewDOMBluetoothDeviceEvent(getter_AddRefs(event), this, nullptr, nullptr);
 
     nsCOMPtr<nsIDOMBluetoothDeviceEvent> e = do_QueryInterface(event);
     e->InitBluetoothDeviceEvent(NS_LITERAL_STRING("devicefound"),
                                 false, false, device);
     DispatchTrustedEvent(event);
   } else if (aData.name().EqualsLiteral("PropertyChanged")) {
     MOZ_ASSERT(v.type() == BluetoothValue::TArrayOfBluetoothNamedValue);
+
     const InfallibleTArray<BluetoothNamedValue>& arr =
       v.get_ArrayOfBluetoothNamedValue();
 
-    MOZ_ASSERT(arr.Length() == 1);
-    SetPropertyByValue(arr[0]);
+    for (uint32_t i = 0, propCount = arr.Length(); i < propCount; ++i) {
+      SetPropertyByValue(arr[i]);
+    }
   } else if (aData.name().EqualsLiteral(DISCOVERY_STATE_CHANGED_ID)) {
     MOZ_ASSERT(v.type() == BluetoothValue::Tbool);
     bool isDiscovering = v.get_bool();
 
     nsCOMPtr<nsIDOMEvent> event;
     NS_NewDOMBluetoothDiscoveryStateChangedEvent(
       getter_AddRefs(event), this, nullptr, nullptr);
 
--- a/dom/bluetooth/BluetoothDevice.cpp
+++ b/dom/bluetooth/BluetoothDevice.cpp
@@ -176,24 +176,24 @@ BluetoothDevice::Create(nsPIDOMWindow* a
 
 void
 BluetoothDevice::Notify(const BluetoothSignal& aData)
 {
   BT_LOGD("[D] %s: %s", __FUNCTION__, NS_ConvertUTF16toUTF8(aData.name()).get());
 
   BluetoothValue v = aData.value();
   if (aData.name().EqualsLiteral("PropertyChanged")) {
-    NS_ASSERTION(v.type() == BluetoothValue::TArrayOfBluetoothNamedValue,
-                 "PropertyChanged: Invalid value type");
+    MOZ_ASSERT(v.type() == BluetoothValue::TArrayOfBluetoothNamedValue);
+
     const InfallibleTArray<BluetoothNamedValue>& arr =
       v.get_ArrayOfBluetoothNamedValue();
 
-    NS_ASSERTION(arr.Length() == 1,
-                 "Got more than one property in a change message!");
-    SetPropertyByValue(arr[0]);
+    for (uint32_t i = 0, propCount = arr.Length(); i < propCount; ++i) {
+      SetPropertyByValue(arr[i]);
+    }
   } else {
 #ifdef DEBUG
     nsCString warningMsg;
     warningMsg.AssignLiteral("Not handling device signal: ");
     warningMsg.Append(NS_ConvertUTF16toUTF8(aData.name()));
     BT_WARNING(warningMsg.get());
 #endif
   }
--- a/dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/gonk/BluetoothServiceBluedroid.cpp
@@ -284,59 +284,58 @@ AdapterStateChangeCallback(bt_state_t aS
 
   if (sIsBtEnabled &&
       NS_FAILED(NS_DispatchToMainThread(new SetupAfterEnabledTask()))) {
     BT_WARNING("Failed to dispatch to main thread!");
   }
 }
 
 /**
- * AdapterPropertiesChangeCallback will be called after enable() but before
- * AdapterStateChangeCallback sIsBtEnabled get updated.
- * At that moment, both BluetoothManager/BluetoothAdapter does not register
- * observer yet.
+ * AdapterPropertiesCallback will be called after enable() but before
+ * AdapterStateChangeCallback sIsBtEnabled get updated. At that moment, both
+ * BluetoothManager/BluetoothAdapter does not register observer yet.
  */
 static void
-AdapterPropertiesChangeCallback(bt_status_t aStatus, int aNumProperties,
-                                bt_property_t *aProperties)
+AdapterPropertiesCallback(bt_status_t aStatus, int aNumProperties,
+                          bt_property_t *aProperties)
 {
   MOZ_ASSERT(!NS_IsMainThread());
 
   BluetoothValue propertyValue;
-  InfallibleTArray<BluetoothNamedValue> propertiesArray;
+  InfallibleTArray<BluetoothNamedValue> props;
 
   for (int i = 0; i < aNumProperties; i++) {
     bt_property_t p = aProperties[i];
 
     if (p.type == BT_PROPERTY_BDADDR) {
       BdAddressTypeToString((bt_bdaddr_t*)p.val, sAdapterBdAddress);
       propertyValue = sAdapterBdAddress;
-      propertiesArray.AppendElement(
+      props.AppendElement(
         BluetoothNamedValue(NS_LITERAL_STRING("Address"), propertyValue));
     } else if (p.type == BT_PROPERTY_BDNAME) {
       // Construct nsCString here because Bd name returned from bluedroid
       // is missing a null terminated character after SetProperty.
       propertyValue = sAdapterBdName = NS_ConvertUTF8toUTF16(
         nsCString((char*)p.val, p.len));
-      propertiesArray.AppendElement(
+      props.AppendElement(
         BluetoothNamedValue(NS_LITERAL_STRING("Name"), propertyValue));
     } else if (p.type == BT_PROPERTY_ADAPTER_SCAN_MODE) {
       bt_scan_mode_t newMode = *(bt_scan_mode_t*)p.val;
 
       if (newMode == BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE) {
         propertyValue = sAdapterDiscoverable = true;
       } else {
         propertyValue = sAdapterDiscoverable = false;
       }
 
-      propertiesArray.AppendElement(
+      props.AppendElement(
         BluetoothNamedValue(NS_LITERAL_STRING("Discoverable"), propertyValue));
     } else if (p.type == BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT) {
       propertyValue = sAdapterDiscoverableTimeout = *(uint32_t*)p.val;
-      propertiesArray.AppendElement(
+      props.AppendElement(
         BluetoothNamedValue(NS_LITERAL_STRING("DiscoverableTimeout"),
                             propertyValue));
     } else if (p.type == BT_PROPERTY_ADAPTER_BONDED_DEVICES) {
       // We have to cache addresses of bonded devices. Unlike BlueZ,
       // bluedroid would not send an another BT_PROPERTY_ADAPTER_BONDED_DEVICES
       // event after bond completed
       bt_bdaddr_t* deviceBdAddressTypes = (bt_bdaddr_t*)p.val;
       int numOfAddresses = p.len / BLUETOOTH_ADDRESS_BYTES;
@@ -347,55 +346,54 @@ AdapterPropertiesChangeCallback(bt_statu
 
       for (int index = 0; index < numOfAddresses; index++) {
         nsAutoString deviceBdAddress;
         BdAddressTypeToString(deviceBdAddressTypes + index, deviceBdAddress);
         sAdapterBondedAddressArray.AppendElement(deviceBdAddress);
       }
 
       propertyValue = sAdapterBondedAddressArray;
-      propertiesArray.AppendElement(
+      props.AppendElement(
         BluetoothNamedValue(NS_LITERAL_STRING("Devices"), propertyValue));
     } else if (p.type == BT_PROPERTY_UUIDS) {
       //FIXME: This will be implemented in the later patchset
-      return;
+      continue;
     } else {
       BT_LOGD("Unhandled adapter property type: %d", p.type);
-      return;
+      continue;
     }
+  }
+
+  NS_ENSURE_TRUE_VOID(props.Length() > 0);
 
-    BluetoothValue value(propertiesArray);
-    BluetoothSignal signal(NS_LITERAL_STRING("PropertyChanged"),
-                           NS_LITERAL_STRING(KEY_ADAPTER), value);
-    nsRefPtr<DistributeBluetoothSignalTask>
-      t = new DistributeBluetoothSignalTask(signal);
-    if (NS_FAILED(NS_DispatchToMainThread(t))) {
-      BT_WARNING("Failed to dispatch to main thread!");
-    }
+  BluetoothValue value(props);
+  BluetoothSignal signal(NS_LITERAL_STRING("PropertyChanged"),
+                         NS_LITERAL_STRING(KEY_ADAPTER), value);
+  nsRefPtr<DistributeBluetoothSignalTask>
+    t = new DistributeBluetoothSignalTask(signal);
+  if (NS_FAILED(NS_DispatchToMainThread(t))) {
+    BT_WARNING("Failed to dispatch to main thread!");
+  }
 
-    // bluedroid BTU task was stored in the task queue, see GKI_send_msg
-    if (!sSetPropertyRunnableArray.IsEmpty()) {
-      DispatchBluetoothReply(sSetPropertyRunnableArray[0], BluetoothValue(true),
-                             EmptyString());
-      sSetPropertyRunnableArray.RemoveElementAt(0);
-    }
+  // bluedroid BTU task was stored in the task queue, see GKI_send_msg
+  if (!sSetPropertyRunnableArray.IsEmpty()) {
+    DispatchBluetoothReply(sSetPropertyRunnableArray[0], BluetoothValue(true),
+                           EmptyString());
+    sSetPropertyRunnableArray.RemoveElementAt(0);
   }
 }
 
-/*
- * RemoteDevicePropertiesChangeCallback will be called, as the
- * following conditions:
+/**
+ * RemoteDevicePropertiesCallback will be called, as the following conditions:
  * 1. When BT is turning on, bluedroid automatically execute this callback
  * 2. When get_remote_device_properties()
  */
 static void
-RemoteDevicePropertiesChangeCallback(bt_status_t aStatus,
-                                     bt_bdaddr_t *aBdAddress,
-                                     int aNumProperties,
-                                     bt_property_t *aProperties)
+RemoteDevicePropertiesCallback(bt_status_t aStatus, bt_bdaddr_t *aBdAddress,
+                               int aNumProperties, bt_property_t *aProperties)
 {
   MOZ_ASSERT(!NS_IsMainThread());
 
   if (sRequestedDeviceCountArray.IsEmpty()) {
     MOZ_ASSERT(sGetDeviceRunnableArray.IsEmpty());
     return;
   }
 
@@ -424,16 +422,25 @@ RemoteDevicePropertiesChangeCallback(bt_
       ClassToIcon(cod, icon);
       props.AppendElement(
         BluetoothNamedValue(NS_LITERAL_STRING("Icon"), BluetoothValue(icon)));
     } else {
       BT_LOGD("Other non-handled device properties. Type: %d", p.type);
     }
   }
 
+  // Update to registered BluetoothDevice objects
+  BluetoothSignal signal(NS_LITERAL_STRING("PropertyChanged"),
+                         remoteDeviceBdAddress, props);
+  nsRefPtr<DistributeBluetoothSignalTask>
+    t = new DistributeBluetoothSignalTask(signal);
+  if (NS_FAILED(NS_DispatchToMainThread(t))) {
+    BT_WARNING("Failed to dispatch to main thread!");
+  }
+
   // Use address as the index
   sRemoteDevicesPack.AppendElement(
     BluetoothNamedValue(remoteDeviceBdAddress, props));
 
   if (sRequestedDeviceCountArray[0] == 0) {
     MOZ_ASSERT(!sGetDeviceRunnableArray.IsEmpty());
 
     if (sGetDeviceRunnableArray.IsEmpty()) {
@@ -648,18 +655,18 @@ CallbackThreadEvent(bt_cb_thread_evt evt
 {
   //FIXME: This will be implemented in the later patchset
 }
 
 bt_callbacks_t sBluetoothCallbacks =
 {
   sizeof(sBluetoothCallbacks),
   AdapterStateChangeCallback,
-  AdapterPropertiesChangeCallback,
-  RemoteDevicePropertiesChangeCallback,
+  AdapterPropertiesCallback,
+  RemoteDevicePropertiesCallback,
   DeviceFoundCallback,
   DiscoveryStateChangedCallback,
   PinRequestCallback,
   SspRequestCallback,
   BondStateChangedCallback,
   AclStateChangedCallback,
   CallbackThreadEvent
 };
--- a/js/src/jit-test/jit_test.py
+++ b/js/src/jit-test/jit_test.py
@@ -163,17 +163,17 @@ def main(argv):
     if options.tbpl:
         # Running all bits would take forever. Instead, we test a few interesting combinations.
         for test in test_list:
             for variant in TBPL_FLAGS:
                 new_test = test.copy()
                 new_test.jitflags.extend(variant)
                 job_list.append(new_test)
     elif options.ion:
-        flags = [['--baseline-eager'], ['--ion-eager']]
+        flags = [['--baseline-eager'], ['--ion-eager', '--ion-parallel-compile=off']]
         for test in test_list:
             for variant in flags:
                 new_test = test.copy()
                 new_test.jitflags.extend(variant)
                 job_list.append(new_test)
     else:
         jitflags_list = jittests.parse_jitflags(options)
         for test in test_list:
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/basic/bug950725.js
@@ -0,0 +1,12 @@
+function test() {
+    + T[g].act
+}
+gc();
+var c = 0;
+for (var i = 0; i < 20; test['$+']) {
+    if (c++ > 110)
+	break;
+    try {
+	__count__(f(2), 1);
+    } catch (e) {}
+}
--- a/js/src/jit/IonFrames.cpp
+++ b/js/src/jit/IonFrames.cpp
@@ -1030,17 +1030,17 @@ MarkJitExitFrame(JSTracer *trc, const Io
             gc::MarkValueRoot(trc, dom->vp(), "ion-dom-args");
         }
         return;
     }
 
     MarkIonCodeRoot(trc, footer->addressOfIonCode(), "ion-exit-code");
 
     const VMFunction *f = footer->function();
-    if (f == nullptr || f->explicitArgs == 0)
+    if (f == nullptr)
         return;
 
     // Mark arguments of the VM wrapper.
     uint8_t *argBase = frame.exitFrame()->argBase();
     for (uint32_t explicitArg = 0; explicitArg < f->explicitArgs; explicitArg++) {
         switch (f->argRootType(explicitArg)) {
           case VMFunction::RootNone:
             break;
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -3680,24 +3680,26 @@ js::SetCallOperation(JSContext *cx)
 {
     JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_BAD_LEFTSIDE_OF_ASS);
     return false;
 }
 
 bool
 js::GetAndClearException(JSContext *cx, MutableHandleValue res)
 {
+    bool status = cx->getPendingException(res);
+    cx->clearPendingException();
+    if (!status)
+        return false;
+
     // Check the interrupt flag to allow interrupting deeply nested exception
     // handling.
-    if (cx->runtime()->interrupt && !js_HandleExecutionInterrupt(cx))
-        return false;
-
-    bool status = cx->getPendingException(res);
-    cx->clearPendingException();
-    return status;
+    if (cx->runtime()->interrupt)
+        return js_HandleExecutionInterrupt(cx);
+    return true;
 }
 
 template <bool strict>
 bool
 js::SetProperty(JSContext *cx, HandleObject obj, HandleId id, const Value &value)
 {
     RootedValue v(cx, value);
     return JSObject::setGeneric(cx, obj, obj, id, &v, strict);