mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 16:14:48 +01:00
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.