JavaScript: Improve API-graph support for function-style classes.

This commit is contained in:
Max Schaefer
2020-10-01 12:05:12 +01:00
parent dfc4436012
commit 98e93a7b9d
2 changed files with 9 additions and 1 deletions

View File

@@ -547,7 +547,11 @@ module API {
ref = DataFlow::moduleImport(m)
)
or
exists(DataFlow::ClassNode cls | nd = MkClassInstance(cls) | ref = cls.getAReceiverNode())
exists(DataFlow::ClassNode cls | nd = MkClassInstance(cls) |
ref = cls.getAReceiverNode()
or
ref = cls.(DataFlow::ClassNode::FunctionStyleClass).getAPrototypeReference()
)
or
nd = MkUse(ref)
or

View File

@@ -20,4 +20,8 @@ MyOtherStream.prototype.write = function (data) { /* use (instance (member MyOth
return this;
};
MyOtherStream.prototype.instanceProp = 1; /* def (member instanceProp (instance (member MyOtherStream (member exports (module classes))))) */
MyOtherStream.classProp = 1; /* def (member classProp (member MyOtherStream (member exports (module classes)))) */
module.exports.MyOtherStream = MyOtherStream;