Skip to content

Commit

Permalink
another fix for #261, use but don't copy prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
a2intl committed Nov 5, 2020
1 parent 85236e7 commit e2d5dde
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 16 deletions.
10 changes: 6 additions & 4 deletions pace.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -287,19 +287,21 @@ _XDomainRequest = window.XDomainRequest
_WebSocket = window.WebSocket

extendNative = (to, from) ->
for key of from::
for key of from
try
if not to[key]? and typeof from[key] isnt 'function'
if typeof Object.defineProperty is 'function'
Object.defineProperty(to, key, {
get: do(key) ->
-> return from::[key];
-> return from[key];
,
configurable: true,
enumerable: true })
else
to[key] = from::[key]
catch e
to[key] = from[key]
catch
to.prototype = from.prototype
return

ignoreStack = []

Expand Down
19 changes: 8 additions & 11 deletions pace.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e2d5dde

Please sign in to comment.