Detection of new line before this
in replace_this_non_prop
in probably buggy
#410
Labels
bug
Something isn't working
this
in replace_this_non_prop
in probably buggy
#410
In JS rewriting, we have a
replace_this_non_prop
rule to for instance transform:a = this;
intoa = _____WB$wombat$check$this$function_____(this)
return this.location
intoreturn _____WB$wombat$check$this$function_____(this).location
and so on.
There is a space case to not replace followings:
a = this.color
(custom globalcolor
, do not care)aaa.this.window=red
(this
is just a random property)There is also a space case to add a semi-colon
;
if previous characters is a new line.However it works only on
aaa\n this.window=red
(2 spaces beforethis
) which is transformed intoaaa\n ;_____WB$wombat$check$this$function_____(this).window=red
.But not on
aaa\nthis.window=red
(0 space beforethis
) oraaa\n this.window=red
(1 space beforethis
) oraaa\n this.window=red
(4 space beforethis
).I think this is a bug, and that this bug is also present upstream in wabac.js. I'm however not exactly sure why one needs to add a semi-colon after the carriage return, so it is hard to know how to fix this properly ATM
The text was updated successfully, but these errors were encountered: