Skip to content

Commit 1bedc72

Browse files
Ensure objects injected in rhino have the expected method names
1 parent 827efef commit 1bedc72

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package plotly.doc;
2+
3+
// Defining these from Java code, so that scalac doesn't give
4+
// those weird looking names under the hood.
5+
public interface Document {
6+
String getElementById(String id);
7+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package plotly.doc;
2+
3+
// Defining these from Java code, so that scalac doesn't give
4+
// those weird looking names under the hood.
5+
public interface Plotly {
6+
void newPlot(String div, Object data, Object layout, Object other);
7+
void newPlot(String div, Object data, Object layout);
8+
void newPlot(String div, Object data);
9+
}

tests/src/test/scala/plotly/doc/DocumentationTests.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ object DocumentationTests {
6363
}
6464
}
6565

66-
private class Plotly {
66+
private class Plotly extends plotly.doc.Plotly {
6767

6868
var dataOpt = Option.empty[Object]
6969
var layoutOpt = Option.empty[Object]
@@ -111,7 +111,7 @@ object DocumentationTests {
111111
}
112112
}
113113

114-
private object Document {
114+
private object Document extends plotly.doc.Document {
115115
// stub...
116116
def getElementById(id: String): String = id
117117
}

0 commit comments

Comments
 (0)