MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / get_inherits

Function get_inherits

code2flow/javascript.py:219–229  ·  view source on GitHub ↗

Gets the superclass of the class. In js, this will be max 1 element :param ast tree: :rtype: list[str]

(tree)

Source from the content-addressed store, hash-verified

217
218
219def get_inherits(tree):
220 """
221 Gets the superclass of the class. In js, this will be max 1 element
222 :param ast tree:
223 :rtype: list[str]
224 """
225 if tree['superClass']:
226 if 'name' in tree['superClass']:
227 return [tree['superClass']['name']]
228 return [djoin(tree['superClass']['object']['name'], tree['superClass']['property']['name'])]
229 return []
230
231
232def get_acorn_version():

Callers 1

make_class_groupMethod · 0.70

Calls 1

djoinFunction · 0.85

Tested by

no test coverage detected