Skip to content

Commit e2d5dde

Browse files
committed
another fix for #261, use but don't copy prototype
1 parent 85236e7 commit e2d5dde

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed

pace.coffee

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,19 +287,21 @@ _XDomainRequest = window.XDomainRequest
287287
_WebSocket = window.WebSocket
288288

289289
extendNative = (to, from) ->
290-
for key of from::
290+
for key of from
291291
try
292292
if not to[key]? and typeof from[key] isnt 'function'
293293
if typeof Object.defineProperty is 'function'
294294
Object.defineProperty(to, key, {
295295
get: do(key) ->
296-
-> return from::[key];
296+
-> return from[key];
297297
,
298298
configurable: true,
299299
enumerable: true })
300300
else
301-
to[key] = from::[key]
302-
catch e
301+
to[key] = from[key]
302+
catch
303+
to.prototype = from.prototype
304+
return
303305

304306
ignoreStack = []
305307

pace.js

Lines changed: 8 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)