-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add Env#getSupportedMimeTypes() #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Env#getSupportedMimeTypes() #17
Conversation
The test coverage seems to be zero. Please increase it a bit. |
* @return a non-null array of a string for each supported MIME type | ||
*/ | ||
public String[] getSupportedMimeTypes() { | ||
return API.getSupportedMimeTypes(vm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand your use-case a method like
public boolean isMimeTypeSupported(String mimeType);
would work for you as well. If so, I prefer it to the array of all mime types.
I switched from Where is the best place to test this? I couldn't see a collection of |
I added a similar test to |
There are few testing languages along EngineTest. Feel free to improve them for testing the mime types. |
Nice test - no hacks, close to the way people will use this API. Once the formatting is fixed, please merge. I'll work on tagging the release then. |
I'm not sure how to fix these javadoc warnings. When I run Am I missing something? |
The right command is: mx javadoc - unified |
Add Env#getSupportedMimeTypes()
…truffle:master to master * commit '8e4dd223cf5ce03b873573c1decf40e1b84a526e': mx testdownstream should only be optional check Gilles suggested this to fix #173: 0.13-SNAPSHOT of truffle-dsl-processor not published
This patch adds the following match rules to generate bitfield move instruction on AArch64: * (RightShift (LeftShift value a) b) -> SBFX/SBFIZ * (UnsignedRightShift (LeftShift value a) b) -> UBFX/UBFIZ * (LeftShift (SignExtend value) a) -> SBFIZ Eg: lsl w0, w1, oracle#8 asr w0, w0, oracle#15 is optimized to: sbfx w0, w1, oracle#7, oracle#17 It also adds the rules to integrate the ZeroExtend with unsigned bitfield move operation. Eg: ubfiz w0, w1, oracle#5, oracle#12 and x0, x0, #0xffffffff is optimized to: ubfiz x0, x1, oracle#5, oracle#12 Change-Id: I2b635d4895db0d5f4c30630176f336e9a226ccaf
…d classloaders (oracle#17) * Implement/fix constant pool writing for classes, packages, modules and classloaders * Fetch JFR type IDs from host JDK instead of hardwiring them. * Precompute and cache type IDs * Fold writing of packages, modules and classloaders into JfrTypeRepository * Removed debug printlns * Renamed count variables to poolCount * Simplify some collections accessors * Return int from JfrTraceIdLoadBarrier.classCount() * Improve comment * Improve JfrTypes enum construction * Add previousEpoch field to all JfrSymbolRepository.getSymbolId() * Remove redundant cast
I want to know what languages are supported in a
PolyglotEngine
. The pressing use-case is in JRuby+Truffle where I want to know if I have a JS interpreter available. I'm currently doing this by just trying to eval withapplication/javascript
and catching any error as an indication that it isn't available. This patch instead checks what languages are available first.jruby/jruby@truffle-execjs...truffle-execjs-list-languages#diff-0c9caf96978e9602deec3f1fca2d97a8L68
The workaround before this patch is slow, even if I end up not using the JavaScript interpreter after finding that it is available. This is 3rd party code for the most part so I can't redesign much.
This is a new API, so a 'large' review. @jtulach @chumer @woess