Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4578c7bb21cf
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6d2be03700c2
Choose a head ref
  • 4 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 25, 2016

  1. Copy the full SHA
    0a53b78 View commit details

Commits on Jan 26, 2016

  1. Copy the full SHA
    c465d06 View commit details

Commits on Feb 1, 2016

  1. Copy the full SHA
    71d774d View commit details
  2. Copy the full SHA
    6d2be03 View commit details
4 changes: 1 addition & 3 deletions lib/ruby/truffle/truffle/truffle/execjs.rb
Original file line number Diff line number Diff line change
@@ -65,9 +65,7 @@ def name
end

def available?
defined?(Truffle::Interop) && Truffle::Interop.eval(JS_MIME_TYPE, 'true')
rescue RubyTruffleError
false
Truffle::Interop.mime_type_supported?('application/javascript')
end

end
21 changes: 21 additions & 0 deletions spec/truffle/specs/truffle/interop/mime_type_supported_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

require_relative '../../../../ruby/spec_helper'

describe "Truffle::Interop.mime_type_supported?" do

it "returns true for application/x-ruby" do
Truffle::Interop.mime_type_supported?('application/x-ruby').should be_true
end

it "returns false for application/x-this-language-does-not-exist" do
Truffle::Interop.mime_type_supported?('application/x-this-language-does-not-exist').should be_false
end

end
2 changes: 1 addition & 1 deletion truffle/pom.rb
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
repository( :url => 'http://lafo.ssw.uni-linz.ac.at/nexus/content/repositories/snapshots/',
:id => 'truffle' )

truffle_version = '6b76a24fffbd52e713a9477f0de62d071674cc90-SNAPSHOT'
truffle_version = 'aa58a258b10c344b8f3abca6a18911435a6f92fc-SNAPSHOT'
jar 'com.oracle.truffle:truffle-api:' + truffle_version
jar 'com.oracle.truffle:truffle-debug:' + truffle_version
jar 'com.oracle.truffle:truffle-dsl-processor:' + truffle_version, :scope => 'provided'
8 changes: 4 additions & 4 deletions truffle/pom.xml
Original file line number Diff line number Diff line change
@@ -41,23 +41,23 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.oracle.truffle</groupId>
<artifactId>truffle-api</artifactId>
<version>6b76a24fffbd52e713a9477f0de62d071674cc90-SNAPSHOT</version>
<version>aa58a258b10c344b8f3abca6a18911435a6f92fc-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.oracle.truffle</groupId>
<artifactId>truffle-debug</artifactId>
<version>6b76a24fffbd52e713a9477f0de62d071674cc90-SNAPSHOT</version>
<version>aa58a258b10c344b8f3abca6a18911435a6f92fc-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.oracle.truffle</groupId>
<artifactId>truffle-dsl-processor</artifactId>
<version>6b76a24fffbd52e713a9477f0de62d071674cc90-SNAPSHOT</version>
<version>aa58a258b10c344b8f3abca6a18911435a6f92fc-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.oracle.truffle</groupId>
<artifactId>truffle-tck</artifactId>
<version>6b76a24fffbd52e713a9477f0de62d071674cc90-SNAPSHOT</version>
<version>aa58a258b10c344b8f3abca6a18911435a6f92fc-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
Original file line number Diff line number Diff line change
@@ -427,6 +427,21 @@ public Object importObject(DynamicObject name) {

}

@CoreMethod(names = "mime_type_supported?", isModuleFunction = true, needsSelf = false, required =1)
public abstract static class MimeTypeSupportedNode extends CoreMethodArrayArgumentsNode {

public MimeTypeSupportedNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@TruffleBoundary
@Specialization(guards = "isRubyString(mimeType)")
public boolean isMimeTypeSupported(DynamicObject mimeType) {
return getContext().getEnv().isMimeTypeSupported(mimeType.toString());
}

}

@CoreMethod(names = "eval", isModuleFunction = true, needsSelf = false, required = 2)
@ImportStatic(StringCachingGuards.class)
public abstract static class EvalNode extends CoreMethodArrayArgumentsNode {