Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove unnessary try catch wrapping in apply and construct

  • Loading branch information...
commit 2b8fd428f39fa8126fa9092a5455580cdfa89862 1 parent fa5c802
Brandon Benvie Benvie authored
Showing with 7 additions and 15 deletions.
  1. +7 −15 lib/bridge.js
22 lib/bridge.js
View
@@ -171,11 +171,7 @@ module.exports = function bridge(win){
if (win) {
mirror.apply = function apply(obj, receiver, args){
- try {
- return wrap(_apply.call(obj, unwrap(receiver), args.map(unwrap)));
- } catch (e) {
- return wrap(e);
- }
+ return wrap(_apply.call(obj, unwrap(receiver), args.map(unwrap)));
};
mirror.set = function set(obj, key, value){
obj[key] = unwrap(value);
@@ -184,18 +180,14 @@ module.exports = function bridge(win){
} else {
var proxyForProxy = function proxyForProxy(fn){
return function(){ return _apply.call(fn, this, arguments) };
- }
+ };
mirror.apply = function apply(obj, receiver, args){
- try {
- // workaround for bug where proxy functions are not valid DOM event handlers
- args = args.map(unwrap);
- if (obj.name === 'addEventListener' && typeof args[1] === 'function') {
- args[1] = proxyForProxy(args[1]);
- }
- return wrap(_apply.call(obj, unwrap(receiver), args));
- } catch (e) {
- return wrap(e);
+ // workaround for bug where proxy functions are not valid DOM event handlers
+ args = args.map(unwrap);
+ if (obj.name === 'addEventListener' && typeof args[1] === 'function') {
+ args[1] = proxyForProxy(args[1]);
}
+ return wrap(_apply.call(obj, unwrap(receiver), args));
};
mirror.set = function set(obj, key, value){
value = unwrap(value);
Please sign in to comment.
Something went wrong with that request. Please try again.