Each text file contains a list of patterns of the form moduleGlob:symbolGlob,
where ? and * special symbols treated as any symbol and zero or more symbols.
A symbol is whitelisted if it's module name and native name pair matches a
pattern in the whitelist, or if a whitelist file is not passed as an argument. All
symbols which are not whitelisted or match a pattern in the blacklist are
excluded from the global table of metadata symbols.
Update metadata-generator submodule
Add a blacklist.mdg file to TestRunner and symlink from the root (because
SRCROOT of TestRunner points to the directory of the main CMakeLists.txt)
Add a unit test which checks for the correct filtering of metadata according to
the rules in blacklist.mdg
Add test case with function returning a struct which is blacklisted
If a struct's metadata is missing it's not possible to silently ignore it and
perform the call, because we don't know its size and cannot reliably
allocate the stack frame for the cif. That's why we'll abort the call and
throw a JS exception
Add test case with functions returning and taking as an argument
objects from a blacklisted class. In this scenario the behavior is the
same as with objects from private classes
Use Objective-C exceptions to propagate errors when filtered
metadata is used and handle them in JSC callbacks
Update metadata generator to use native names in type encodings
to allow correct discovery of interfaces and protocols when they
have been filtered
[x] There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
Metadata is generated for all discovered supported native symbols
What is the new behavior?
Metadata can be filtered by specifying a whitelist and/or blacklist in
two files residing in $(SRCROOT) (blacklist.mdg and whitelist.mdg).
Each line should be of the form module-name-pattern[:symbol-name-pattern].
Each text file contains a list of patterns of the form
moduleGlob:symbolGlob
, where?
and*
special symbols treated asany symbol
andzero or more symbols
.A symbol is whitelisted if it's module name and native name pair matches a pattern in the whitelist, or if a whitelist file is not passed as an argument. All symbols which are not whitelisted or match a pattern in the blacklist are excluded from the global table of metadata symbols.
blacklist.mdg
file to TestRunner and symlink from the root (because SRCROOT of TestRunner points to the directory of the main CMakeLists.txt)blacklist.mdg
PR Checklist
What is the current behavior?
Metadata is generated for all discovered supported native symbols
What is the new behavior?
Metadata can be filtered by specifying a whitelist and/or blacklist in two files residing in $(SRCROOT) (
blacklist.mdg
andwhitelist.mdg
). Each line should be of the formmodule-name-pattern[:symbol-name-pattern]
.refs #1209