1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 16:14:48 +01:00
Alex Osborne 791a8d1033
rewrite: stop prepending semicolon to this. special property access (#850) (#888)
The prepended semicolon breaks code (such as jQuery) that looks like:

    foo = foo ? foo :
                this.location;

I think the reason we started inserting the semicolon was because in situations like:

    x = 1 + 2
    this.location = "foo"

we used to rewrite to:

    x = 1 + 2
    (this && this._WB_wombat_obj_proxy || this).location = "foo"

which the browser would interpret as a bogus function call like `2(this && ... )`.
But nowadays prepending the semicolon should be unnecessary as we currently rewrite to:

    x = 2 + 3
    _____WB$wombat$check$this$function_____(this).location = "foo"

which will trigger JavaScript's automatic semicolon insertion rules like the original code does.
2024-04-09 09:37:55 -07:00
..
2014-02-17 10:01:09 -08:00
2022-08-31 18:49:45 -07:00
2022-08-31 18:49:45 -07:00
2020-04-30 22:39:47 -07:00
2018-05-21 19:29:33 -07:00
2019-07-02 19:24:11 -07:00
2024-04-02 17:16:50 -04:00
2019-07-02 19:24:11 -07:00