def transpile_modname_source_target(self, spec, modname, source, target):
"""
The function that gets called by compile_transpile_entry for
processing the provided JavaScript source file provided by some
Python package through the transpiler instance.
"""
if not isinstance(self.transpiler, BaseUnparser):
_deprecation_warning(
'transpiler callable assigned to %r must be an instance of '
'calmjs.parse.unparsers.base.BaseUnparser by calmjs-4.0.0; '
'if the original transpile behavior is to be retained, the '
'subclass may instead override this method to call '
'`simple_transpile_modname_source_target` directly, as '
'this fallback behavior will be removed by calmjs-4.0.0' % (
self,
)
)
return self.simple_transpile_modname_source_target(
spec, modname, source, target)
# do the new thing here.
return self._transpile_modname_source_target(
spec, modname, source, target)
评论列表
文章目录