Load target modules. Set to 0 if package is already defined in other files and cannot be require -ed. If set to false, do not warn if target modules are loaded before the patch module.
By default, it warns to prevent users making the mistake of importing subroutines from target modules before they are patched. Die if there is conflict with other patch modules, for example if target module has been patched 'delete' and another patch wants to 'wrap' it. Force patching even if target module version does not match. The default is to warn and skip patching. Sometimes the target module is not easily subclassable or at all.
But even if the target module is subclassable, all client code must explicitly use the subclass. Patching allows us to modify behavior of a target module without changing any client code that use that module.
Not all patches are potentials for inclusion into the upstream target module. But even if a patch is, creating and releasing a patch module can get you something working sooner while you wait for the original author to respond to your patch, if ever. If Target::Module exports symbols, and you patch one of the default exports, the users need to patch before importing.
For example, this won't work:. Connect and share knowledge within a single location that is structured and easy to search. How can I use a custom classpath when overriding a native class like java. Matcher in a non-modular code base. Because the modified Matcher. Say I have modified java.
Matcher and now it requires some other non-java external. So how can I patch it like: javac --patch-module java.
It has the same directory structure as the above. If you could tell me how to compile the two classes in there, that would be more than enough. However the only requirement is that MyClass. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to use --patch-module along with --class-path javac Ask Question. Asked 3 years, 10 months ago.
Active 3 years, 10 months ago. Monkey patch node modules MIT License. Branches Tags. Could not load branches. Could not load tags. Latest commit. Git stats 1 commit. Failed to load latest commit information. View code. About Monkey patch node modules Resources Readme. MIT License. Releases No releases published. Packages 0 No packages published. You signed in with another tab or window.
0コメント