servo/components/script/dom
bors-servo 06bb57bdcb Auto merge of #13406 - Mylainos:issue-13377, r=jdm
Extract panic-catching for JS engine callbacks into a separate function

All of our generated code for script contains inline code like this:
```
let result = panic::catch_unwind(AssertUnwindSafe(|| {
    ...
};
match result {
    Ok(result) => result,
    Err(error) => {
        store_panic_result(error);
        return false;
    }
}
```
This PR change it to something like this:
```
wrap_panic(|| { ... }, false)
```

---
- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] These changes fix #13377

- [ ] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13406)
<!-- Reviewable:end -->
2016-09-27 09:58:42 -05:00
..
bindings Auto merge of #13406 - Mylainos:issue-13377, r=jdm 2016-09-27 09:58:42 -05:00
webgl_validations webgl: Refactor texture validations to take advantage of rust type system 2016-06-25 00:03:15 +02:00
webidls Auto merge of #13422 - SecurityInsanity:master, r=KiChjang 2016-09-27 01:24:28 -05:00
abstractworker.rs Remove dead error handling code. 2016-09-05 17:53:53 +02:00
abstractworkerglobalscope.rs implement related sw interface and register method 2016-06-02 04:09:39 +05:30
activation.rs One last refactoring before fixing 2016-09-18 05:57:24 -05:00
attr.rs Make DOMRefCell use style’s copy of RefCell 2016-08-31 02:34:04 +02:00
beforeunloadevent.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
blob.rs Refactored a couple of files from codeStyle to code_style. 2016-09-17 20:31:46 -05:00
bluetooth.rs Annotations for requestDevice, request_bluetooth_devices and matches_filter functions 2016-09-14 08:41:03 +02:00
bluetoothadvertisingdata.rs Refactored a couple of files from codeStyle to code_style. 2016-09-17 20:31:46 -05:00
bluetoothcharacteristicproperties.rs Refactored a bluetooth* related files from codeStyle to code_style. 2016-09-18 00:07:32 -05:00
bluetoothdevice.rs Refactored a bluetooth* related files from codeStyle to code_style. 2016-09-18 00:07:32 -05:00
bluetoothremotegattcharacteristic.rs Refactored a bluetooth* related files from codeStyle to code_style. 2016-09-18 00:07:32 -05:00
bluetoothremotegattdescriptor.rs Refactored a bluetooth* related files from codeStyle to code_style. 2016-09-18 00:07:32 -05:00
bluetoothremotegattserver.rs Reorder use statements 2016-09-09 04:55:19 +02:00
bluetoothremotegattservice.rs Refactored a bluetooth* related files from codeStyle to code_style. 2016-09-18 00:07:32 -05:00
bluetoothuuid.rs Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
browsingcontext.rs Fix my typo on commit. Rest of the fixes will be here soon. 2016-09-18 07:32:05 -05:00
canvasgradient.rs Reorder use statements 2016-09-09 04:55:19 +02:00
canvaspattern.rs
canvasrenderingcontext2d.rs More code refactoring (exampleVar to example_var) 2016-09-18 01:02:57 -05:00
characterdata.rs Make DOMRefCell use style’s copy of RefCell 2016-08-31 02:34:04 +02:00
client.rs Replace instances of old ServiceWorker specification URL with new one 2016-09-25 20:32:32 +05:30
closeevent.rs More code refactoring (exampleVar to example_var) 2016-09-18 01:02:57 -05:00
comment.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
console.rs More code refactoring (exampleVar to example_var) 2016-09-18 01:02:57 -05:00
create.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
crypto.rs Compile WebIDL return type "object" to NonZero<*mut JSObject> 2016-08-30 19:07:13 +02:00
css.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
cssstyledeclaration.rs Auto merge of #13134 - servo:archery, r=emilio 2016-08-31 16:30:56 -05:00
customevent.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
dedicatedworkerglobalscope.rs Return an enum instead of a boolean from dispatch_event 2016-09-26 17:52:38 +02:00
document.rs Auto merge of #13397 - aochagavia:dispatch-event, r=Ms2ger 2016-09-26 12:09:48 -05:00
documentfragment.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
documenttype.rs Inline DOM element creation into box expressions in components/script/dom/ 2016-07-14 08:44:22 +02:00
domexception.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
domimplementation.rs Reorder use statements 2016-09-09 04:55:19 +02:00
dommatrix.rs DOMMatrix and DOMMatrixReadOnly 2016-09-15 00:16:42 +01:00
dommatrixreadonly.rs DOMMatrix and DOMMatrixReadOnly 2016-09-15 00:16:42 +01:00
domparser.rs Reorder use statements 2016-09-09 04:55:19 +02:00
dompoint.rs Made fixes for PR. 2016-09-18 07:12:39 -05:00
dompointreadonly.rs Made fixes for PR. 2016-09-18 07:12:39 -05:00
domquad.rs Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
domrect.rs
domrectlist.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
domrectreadonly.rs
domstringmap.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
domtokenlist.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
element.rs Auto merge of #12703 - sjmelia:12343_test_activation, r=Manishearth 2016-09-16 20:34:25 -05:00
errorevent.rs Switch to using the new rooted!/RootedGuard API for rooting. 2016-07-04 20:59:01 +03:00
event.rs Return an enum instead of a boolean from dispatch_event 2016-09-26 17:52:38 +02:00
eventdispatcher.rs Return an enum instead of a boolean from dispatch_event 2016-09-26 17:52:38 +02:00
eventsource.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
eventtarget.rs Return an enum instead of a boolean from dispatch_event 2016-09-26 17:52:38 +02:00
extendableevent.rs Silence a warning in ExtendableEvent::WaitUntil 2016-09-21 15:38:51 +02:00
extendablemessageevent.rs implement ExtendableEvent as base type for ServiceWorker events 2016-09-17 20:58:46 +05:30
file.rs Replace typeString with type_string. 2016-09-17 20:31:46 -05:00
filelist.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
filereader.rs Implement file reading task source 2016-07-14 13:27:42 -04:00
filereadersync.rs Add FileReaderSync skeleton 2016-07-31 09:19:39 +02:00
focusevent.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
forcetouchevent.rs Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
formdata.rs Added FormData Iterable 2016-09-23 10:19:11 -04:00
hashchangeevent.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
headers.rs Enable OpenEndedDictionary in Headers 2016-09-22 15:01:34 -07:00
history.rs Use fn pipeline_id consistently, not fn pipeline 2016-09-13 15:17:40 -04:00
htmlanchorelement.rs Bring referrer policy delivery to <a> and <link> via rel attribute 2016-09-20 21:17:37 +08:00
htmlappletelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlareaelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlaudioelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlbaseelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlbodyelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlbrelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlbuttonelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlcanvaselement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlcollection.rs implement HTMLOptionsCollection and add related items to HTMLSelectElement 2016-09-26 21:49:10 +03:00
htmldataelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmldatalistelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmldetailselement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmldialogelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmldirectoryelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmldivelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmldlistelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlembedelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlfieldsetelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlfontelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlformcontrolscollection.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
htmlformelement.rs Issue #13350 Report tidy error for space after ( 2016-09-23 14:01:58 +02:00
htmlframeelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlframesetelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlheadelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlheadingelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlhrelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlhtmlelement.rs Inline DOM element creation into box expressions in components/script/dom/ 2016-07-14 08:44:22 +02:00
htmliframeelement.rs Replace current session entry for reloads 2016-09-19 14:23:03 -05:00
htmlimageelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlinputelement.rs Implement minlength for text inputs 2016-09-21 07:54:39 -05:00
htmllabelelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmllegendelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmllielement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmllinkelement.rs use .set_tokenlist_attribute to set rel content attribute in SetRel 2016-09-23 17:36:59 +00:00
htmlmapelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlmediaelement.rs Bring referrer policy delivery to <a> and <link> via rel attribute 2016-09-20 21:17:37 +08:00
htmlmetaelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlmeterelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlmodelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlobjectelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlolistelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmloptgroupelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmloptionelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmloptionscollection.rs implement HTMLOptionsCollection and add related items to HTMLSelectElement 2016-09-26 21:49:10 +03:00
htmloutputelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlparagraphelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlparamelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlpreelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlprogresselement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlquoteelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlscriptelement.rs Auto merge of #13397 - aochagavia:dispatch-event, r=Ms2ger 2016-09-26 12:09:48 -05:00
htmlselectelement.rs implement HTMLOptionsCollection and add related items to HTMLSelectElement 2016-09-26 21:49:10 +03:00
htmlsourceelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlspanelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlstyleelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltablecaptionelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltablecellelement.rs Stop re-exporting AttrValue. 2016-06-07 13:15:23 +02:00
htmltablecolelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltabledatacellelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltableelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltableheadercellelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltablerowelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltablesectionelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltemplateelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltextareaelement.rs Implement minlength for text inputs 2016-09-21 07:54:39 -05:00
htmltimeelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltitleelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmltrackelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlulistelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlunknownelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
htmlvideoelement.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
imagedata.rs Compile WebIDL return type "object" to NonZero<*mut JSObject> 2016-08-30 19:07:13 +02:00
keyboardevent.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
location.rs Make Assign throw error on invalid url 2016-09-26 11:03:22 -06:00
macros.rs Implement HTMLLIElement#value 2016-07-28 21:07:21 -03:00
mediaerror.rs
messageevent.rs Switch to using the new rooted!/RootedGuard API for rooting. 2016-07-04 20:59:01 +03:00
mimetype.rs Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
mimetypearray.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
mod.rs implement HTMLOptionsCollection and add related items to HTMLSelectElement 2016-09-26 21:49:10 +03:00
mouseevent.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
namednodemap.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
navigator.rs Replace instances of old ServiceWorker specification URL with new one 2016-09-25 20:32:32 +05:30
navigatorinfo.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
node.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
nodeiterator.rs Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
nodelist.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
pagetransitionevent.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
performance.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
performancetiming.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
plugin.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
pluginarray.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
popstateevent.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
processinginstruction.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
progressevent.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
promise.rs Remove maybe_ prefix from Promise methods. 2016-09-22 16:21:23 -04:00
promisenativehandler.rs Support native promise callbacks. 2016-09-22 16:16:52 -04:00
radionodelist.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
range.rs Reorder use statements 2016-09-09 04:55:19 +02:00
request.rs Enable OpenEndedDictionary in Headers 2016-09-22 15:01:34 -07:00
response.rs dom::Response implementation 2016-09-06 19:58:32 -07:00
screen.rs
serviceworker.rs Replace instances of old ServiceWorker specification URL with new one 2016-09-25 20:32:32 +05:30
serviceworkercontainer.rs Replace instances of old ServiceWorker specification URL with new one 2016-09-25 20:32:32 +05:30
serviceworkerglobalscope.rs Replace instances of old ServiceWorker specification URL with new one 2016-09-25 20:32:32 +05:30
serviceworkerregistration.rs Replace instances of old ServiceWorker specification URL with new one 2016-09-25 20:32:32 +05:30
servohtmlparser.rs Excise SubpageId and use only PipelineIds 2016-09-13 15:37:38 -04:00
servoxmlparser.rs
storage.rs Made fixes for PR. 2016-09-18 07:12:39 -05:00
storageevent.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
stylesheet.rs Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
stylesheetlist.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
testbinding.rs Remove maybe_ prefix from Promise methods. 2016-09-22 16:21:23 -04:00
testbindingiterable.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
testbindingpairiterable.rs Implement pair iterators in WebIDL interfaces. 2016-08-24 11:26:01 -04:00
testbindingproxy.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
text.rs Report use statements that use {} with only one entry 2016-05-27 10:18:44 +01:00
textdecoder.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
textencoder.rs removed support for UTF-16 in TextEncoder 2016-09-27 05:44:52 +05:30
touch.rs
touchevent.rs Most of the code refactoring needed to be done is done with this commit. 2016-09-18 03:41:16 -05:00
touchlist.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
treewalker.rs Reorder use statements 2016-09-09 04:55:19 +02:00
uievent.rs Reorder use statements 2016-09-09 04:55:19 +02:00
url.rs Made fixes for PR. 2016-09-18 07:12:39 -05:00
urlhelper.rs Made fixes for PR. 2016-09-18 07:12:39 -05:00
urlsearchparams.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
userscripts.rs Use Result instead of panicking when the resource dir can't be found 2016-07-21 12:07:25 +05:30
validation.rs
validitystate.rs Remove empty lines following braces. 2016-05-27 13:32:05 -04:00
values.rs
virtualmethods.rs Implement HTMLLIElement#value 2016-07-28 21:07:21 -03:00
webglactiveinfo.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
webglbuffer.rs Use wrappers for GL IDs 2016-06-28 20:11:55 +02:00
webglcontextevent.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
webglframebuffer.rs webgl: Do validation that the framebuffer is complete for FBO operations. 2016-09-21 08:05:45 +10:00
webglobject.rs
webglprogram.rs webgl: Add isProgram() support. 2016-08-28 17:18:09 -07:00
webglrenderbuffer.rs Use wrappers for GL IDs 2016-06-28 20:11:55 +02:00
webglrenderingcontext.rs implement WebGLRenderingContext::isEnabled 2016-09-22 13:44:35 +03:00
webglshader.rs Use wrappers for GL IDs 2016-06-28 20:11:55 +02:00
webglshaderprecisionformat.rs
webgltexture.rs Use wrappers for GL IDs 2016-06-28 20:11:55 +02:00
webgluniformlocation.rs Use wrappers for GL IDs 2016-06-28 20:11:55 +02:00
websocket.rs Made fixes for PR. 2016-09-18 07:12:39 -05:00
window.rs Bring referrer policy delivery to <a> and <link> via rel attribute 2016-09-20 21:17:37 +08:00
worker.rs Return an enum instead of a boolean from dispatch_event 2016-09-26 17:52:38 +02:00
workerglobalscope.rs Support promises in workers. 2016-09-22 16:16:55 -04:00
workerlocation.rs Made fixes for PR. 2016-09-18 07:12:39 -05:00
workernavigator.rs Move DOMString back to script 2016-05-24 10:54:57 +02:00
xmldocument.rs Use Option<T> to return from getters 2016-08-30 19:07:19 +02:00
xmlhttprequest.rs Add FetchMetadata and update corresponding methods 2016-09-21 14:26:03 -07:00
xmlhttprequesteventtarget.rs
xmlhttprequestupload.rs