Skip to content

Conversation

@thiemowmde
Copy link
Contributor

This ReferenceError: evilsSeed is not defined is driving me crazy. I can always reproduce it by simply shift+reloading a page in my local Wikibase Repo. This is a huge pain when debugging.

Update: #45 removes this feature. It should be readded when the PhantomJS bug mentioned below got fixed and the Travis tests pass.

@thiemowmde thiemowmde added the bug label Jul 7, 2014
@thiemowmde thiemowmde added this to the 0.6 milestone Jul 7, 2014
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you change this? namedFn should always == true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be sure. It may be superfluous but it doesn't hurt.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superfluous code can be very misleading

@thiemowmde
Copy link
Contributor Author

@mariushoch @filbertkm @tobijat Rage! This stupid bug keeps wasting my time. Merge! Also: WTF is wrong with Travis?

@mariushoch
Copy link
Member

Long story short: Neither Function.apply nor Function.bind exist in the JS engine used by phantomjs. There's a polyfill for Function.bind1 but that doesn't work here as Function.apply also doesn't exist (and I couldn't find a polyfill for that).

I would suggest to completely remove this named functions code for now... the problems/ costs caused by that are just to huge (I just spent ages debugging phantomjs...).

@thiemowmde
Copy link
Contributor Author

@mariushoch What now? I spent months debugging this issue. I'm now 100% sure this is the right way to do it. The tests pass in all browsers. Are you telling me we are disallowed to use JavaScript correctly because Travis uses a broken JS engine?

@mariushoch
Copy link
Member

I'm not sure how to move forward here... either kill the whole named function thing or allow the tests to fail until phantomjs gets fixed or we run the tests in another way, I guess.

@thiemowmde thiemowmde removed this from the 0.6 milestone Jul 16, 2014
@thiemowmde thiemowmde changed the title Get rid of "evilsSeed is not defined" [WIP] Get rid of "evilsSeed is not defined" Jul 16, 2014
@mariushoch
Copy link
Member

No longer needed as we decided to remove evilsSeed completely

@mariushoch mariushoch closed this Jul 22, 2014
@thiemowmde
Copy link
Contributor Author

Erm, no? Why? Didn't I explained that in #45?

@thiemowmde thiemowmde reopened this Jul 22, 2014
@thiemowmde thiemowmde changed the title [WIP] Get rid of "evilsSeed is not defined" [WIP] Reimplement removed createNamedFunction Jul 22, 2014
@thiemowmde thiemowmde changed the title [WIP] Reimplement removed createNamedFunction [WIP] Reimplement removed constructor naming Jul 22, 2014
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

namedFn = new Function( 'fn', 'return function ' + fnName +
    '() { return fn.apply( this, arguments ); };' )( evilsSeed );

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay for the 'fn' bit. Need to test this but looks good. Nay for the dropped bind. I think this is crucial.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it crucial?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was when I played around with my version. Since this is hard/impossible to test I'm afraid to change my version (the only one that works for sure, as far as I know) to something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants