Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't support foo?bar:bak syntax with strings #2

Open
iggyvolz opened this issue Mar 16, 2014 · 1 comment
Open

Doesn't support foo?bar:bak syntax with strings #2

iggyvolz opened this issue Mar 16, 2014 · 1 comment

Comments

@iggyvolz
Copy link

The obfuscator breaks on foo?bar:bak. Example:
private static const production:Boolean=true;
private var apiURL:String=production?"http://localhost":"http://my.production.site.example.com";
public function Foo():void
{
}

Leads to
private static const _HLW6Z:Boolean=true;
private var _WLPCE:String=_HLW6Z?"\x68\x74\x74\x70\x3a public function _ZYM4a():void
{
}

@derrickb
Copy link

derrickb commented May 30, 2018

I haven't tested this extensively, but splitting it over multiple lines appears to work, eg:

private var apiURL:String = production ?
    "http://localhost" :
    "http://my.production.site.example.com";

EDIT: I Just ran a test with your specific example and it worked fine for me. Note that I renamed the "production" variable to "isProduction", otherwise it replaces the substring in http://my.production...

private static const isProduction:Boolean = true;
private var apiURL:String = isProduction ? "http://localhost" : "http://my.production.site.example.com";

yields:

private static const _8BZHP:Boolean = true;
private var _2E0QN:String = _8BZHP ? "http://localhost" : "http://my.production.site.example.com";

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

No branches or pull requests

3 participants