Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

modify throwing error #2

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

Hi

An error occurs in running sample/tutorial.js as below.

Nondeterministic Programs

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
ReferenceError: Enumerable is not defined

As "Enumerable" is not global object anymore by your commit ( 4905beb ), string literal cannot eval as function.

I think it is better string literal cannot use in npm linq.
What do you think of?

Owner

mihaifm commented Apr 10, 2012

Ok that makes sense.
But maybe we shouldn't exclude that string literal syntax.

One way to make it work would be to bind all the lambda functions to Enumerable, so you could write

.Where("this.From($).Distinct('$.Value').Count() == 5")

The change would be here: https://github.com/mihaifm/linq/blob/master/linq.js#L2112-2117
Just need to add .bind(Enumerable) to the new Function

Do you think this might be ok? Tests seem fine with this change.

Thank you for reply.
Your change is better than my request.
But your cahnge is nor recognize this url: https://github.com/mihaifm/linq/blob/master/linq.js#L2112-2117
Do you mean this? https://gist.github.com/2351692

If it is wright, test is fine! Thank you.

Owner

mihaifm commented Apr 10, 2012

I was just showing the lines of code where it needs to be done.
Yea, that's pretty much it.
I'll make this update.

OK. I rush for a conclusion.
Thank you very much.
I close my issue.

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