adds the dynamic method call for JS snippet