1- /*! Raven.js 3.21 .0 (fbfea0f ) | github.com/getsentry/raven-js */
1+ /*! Raven.js 3.22 .0 (50583ff ) | github.com/getsentry/raven-js */
22
33/*
44 * Includes TraceKit
55 * https://github.com/getsentry/TraceKit
66 *
7- * Copyright 2017 Matt Robenolt and other contributors
7+ * Copyright 2018 Matt Robenolt and other contributors
88 * Released under the BSD license
99 * https://github.com/getsentry/raven-js/blob/master/LICENSE
1010 *
@@ -124,6 +124,10 @@ function isFunction(what) {
124124 return typeof what === 'function' ;
125125}
126126
127+ function isPlainObject ( what ) {
128+ return Object . prototype . toString . call ( what ) === '[object Object]' ;
129+ }
130+
127131function isString ( what ) {
128132 return Object . prototype . toString . call ( what ) === '[object String]' ;
129133}
@@ -133,6 +137,8 @@ function isArray(what) {
133137}
134138
135139function isEmptyObject ( what ) {
140+ if ( ! isPlainObject ( what ) ) return false ;
141+
136142 for ( var _ in what ) {
137143 if ( what . hasOwnProperty ( _ ) ) {
138144 return false ;
@@ -269,8 +275,8 @@ function urlencode(o) {
269275// intentionally using regex and not <a/> href parsing trick because React Native and other
270276// environments where DOM might not be available
271277function parseUrl ( url ) {
278+ if ( typeof url !== 'string' ) return { } ;
272279 var match = url . match ( / ^ ( ( [ ^ : \/ ? # ] + ) : ) ? ( \/ \/ ( [ ^ \/ ? # ] * ) ) ? ( [ ^ ? # ] * ) ( \? ( [ ^ # ] * ) ) ? ( # ( .* ) ) ? $ / ) ;
273- if ( ! match ) return { } ;
274280
275281 // coerce to undefined values to empty string so we don't get 'undefined'
276282 var query = match [ 6 ] || '' ;
@@ -487,6 +493,7 @@ module.exports = {
487493 isErrorEvent : isErrorEvent ,
488494 isUndefined : isUndefined ,
489495 isFunction : isFunction ,
496+ isPlainObject : isPlainObject ,
490497 isString : isString ,
491498 isArray : isArray ,
492499 isEmptyObject : isEmptyObject ,
0 commit comments