Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function recompile(context) {
- var previous = {values: context.previous};
- previous.argnames = previous.values.map(function cmpArgNames(_, i) { return 'previous' + i });
- previous.funcalls = previous.values.map(function cmpFunCalls(f, i) {
- var args = (f.length === 1 ? '(recv)' : '(recv, args, context.storage)');
- return previous.argnames[i] + args;
- });
- var future = {values: context.future};
- future.argnames = future.values.map(function(_, i) { return 'future' + i });
- future.funcalls = future.values.map(function(f, i) {
- var args = (f.length === 2 ? '(recv, rval)' : '(recv, args, rval, context.storage)');
- return future.argnames[i] + args;
- });
- var source = require('util').format(
- ' (function(%s) { n return function(recv, args) { n try{%s;}catch(e){logProbeErrorMessage(e, recv, context.target, true);} n var rval = context.target.apply(recv, args); n try{%s;}catch(e){logProbeErrorMessage(e, recv, context.target, null, true);} n return rval; n }; n }) n' ,
- ['context'].concat(previous.argnames).concat(future.argnames),
- previous.funcalls.join(';n'), future.funcalls.join(';n'));
- var args = [context].concat(previous.values).concat(future.values);
- return eval(source).apply(null, args);
- }
- var source = require('util').format(
- ' (function(%s) { n return function(recv, args) { n try{%s;}catch(e){logProbeErrorMessage(e, recv, context.target, true);} n var rval = context.target.apply(recv, args); n try{%s;}catch(e){logProbeErrorMessage(e, recv, context.target, null, true);} n return rval; n }; n }) n' ,
- ['context'].concat(previous.argnames).concat(future.argnames),
- previous.funcalls.join(';n'), future.funcalls.join(';n'));
- (function(context) {
- return function(recv, args) {
- try{;}catch(e){logProbeErrorMessage(e, recv, context.target, true);}
- var rval = context.target.apply(recv, args);
- try{;}catch(e){logProbeErrorMessage(e, recv, context.target, null, true);}
- return rval;
- };
- })
- (function([ 'context' ]) {
- return function(recv, args) {
- try{;}catch(e){logProbeErrorMessage(e, recv, context.target, true);}
- var rval = context.target.apply(recv, args);
- try{;}catch(e){logProbeErrorMessage(e, recv, context.target, null, true);}
- return rval;
- };
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement