1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

rewrite fix: don't inject checkThis function into every script, now handled by wombat via prototype (#516)

update to latest wombat (includes webrecorder/wombat#19, webrecorder/wombat#18, webrecorder/wombat#17)
This commit is contained in:
Ilya Kreymer 2019-11-06 16:55:34 -08:00 committed by GitHub
parent 44dcd39c02
commit fe09d9991e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 9 deletions

View File

@ -67,14 +67,12 @@ return (self._wb_wombat && self._wb_wombat.local_init && \
self._wb_wombat.local_init(name)) || self[name]; }};\n\
if (!self.__WB_pmw) {{ self.__WB_pmw = function(obj) {{ this.__WB_source = obj; return this; }} }}\n\
{{\n'
local_check_this_fn = 'var {0} = function (thisObj) {{ \
if (thisObj && thisObj._WB_wombat_obj_proxy) return thisObj._WB_wombat_obj_proxy; return thisObj; }};'
local_init_func_name = '_____WB$wombat$assign$function_____'
local_var_line = 'let {0} = {1}("{0}");'
local_init_func = local_init_func.format(local_init_func_name)
local_check_this_func_name = '_____WB$wombat$check$this$function_____'
local_var_line = 'let {0} = {1}("{0}");'
# we must use a function to perform the this check because most minfiers reduce the number of statements
# by turning everything into one or more expressions. Our previous rewrite was an logical expression,
@ -124,8 +122,7 @@ if (thisObj && thisObj._WB_wombat_obj_proxy) return thisObj._WB_wombat_obj_proxy
super(JSWombatProxyRules, self).__init__(rules)
self.first_buff = local_check_this_fn.format(local_check_this_func_name) + local_init_func.format(
local_init_func_name) + local_declares + '\n\n'
self.first_buff = local_init_func + local_declares + '\n\n'
self.last_buff = '\n\n}'

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
wombat

@ -1 +1 @@
Subproject commit 056ee99d16397c85fad54c4e04c53fabdc880d76
Subproject commit 50ff6e3ed3afc2fd27f82bae4f5f20194f1bfc53