Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

javascript variable that starts with '$' parsed incorrectly #1

Open
scramatte opened this issue Jan 25, 2010 · 4 comments
Open

javascript variable that starts with '$' parsed incorrectly #1

scramatte opened this issue Jan 25, 2010 · 4 comments

Comments

@scramatte
Copy link

Hello,

If you have javascript variable that starts with '$' jsmin-php parse it incorrectly resulting in javascript error. In mootools/mif tree project (http://github.com/creaven/miftree) the author use this.$ = {} or this.$index = null. Jsmin-php is unable to recognize this syntax.

@digggggggggg
Copy link

Same problem here.

@kerphi
Copy link

kerphi commented Jun 20, 2011

Nobody for a patch to correct this issue ?

@Krinkle
Copy link

Krinkle commented Oct 17, 2011

I saw a patch for this at some point but lost it. I'm terrible at regexes but I think the problem is in the isAlphaNum function.

Below is what the function looks like in the current master:

  protected function isAlphaNum($c) {
    return ord($c) > 126 || $c === '\\' || preg_match('/^[\w\$]$/', $c) === 1;

@jaydiablo
Copy link

I added the mif.tree library (1.2.6.4 as of this writing) as a test case in my fork on js-min-php and it passes against the C version of jsmin. The output from my fork doesn't exhibit a JS error, possibly an outdated bug?

https://github.com/jaydiablo/jsmin-php

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants