You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
I had a hard time debugging why my specs were passing on the browser but failing on console, until I found the PhantomJS #10522 issue, and later found out that jasmine-rails already provides a bind shim (thus rendering my application's shim useless).
jasmine-rails' current shim might work for some cases (like #68), but it totally breaks my application. I tested MDN's first and simplest example, and it didn't work:
varx=9;varmodule={x: 81,getX: function(){returnthis.x;}};module.getX();// 81vargetX=module.getX;getX();// 9, because in this case, "this" refers to the global object// create a new function with 'this' bound to modulevarboundGetX=getX.bind(module);boundGetX();// should be 81
Could we change the default shim to the one provided on MDN's page? I don't know if this will break @islandr's specs, but it seems to be a more conforming version. Here it is:
I had a hard time debugging why my specs were passing on the browser but failing on console, until I found the PhantomJS #10522 issue, and later found out that jasmine-rails already provides a bind shim (thus rendering my application's shim useless).
jasmine-rails' current shim might work for some cases (like #68), but it totally breaks my application. I tested MDN's first and simplest example, and it didn't work:
Could we change the default shim to the one provided on MDN's page? I don't know if this will break @islandr's specs, but it seems to be a more conforming version. Here it is:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
The text was updated successfully, but these errors were encountered: