Skip to content

Commit 02b441a

Browse files
committed
disable NativeObject in Rhino because it is a hotspot internal api and compile error in OpenJDK #93
1 parent 9f5a649 commit 02b441a

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

webmagic-scripts/src/main/java/us/codecraft/webmagic/scripts/ScriptProcessor.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.apache.commons.io.IOUtils;
44
import org.jruby.RubyHash;
55
import org.python.core.PyDictionary;
6-
import sun.org.mozilla.javascript.internal.NativeObject;
76
import us.codecraft.webmagic.Page;
87
import us.codecraft.webmagic.Site;
98
import us.codecraft.webmagic.processor.PageProcessor;
@@ -58,13 +57,13 @@ public void process(Page page) {
5857
switch (language) {
5958
case JavaScript:
6059
engine.eval(defines + "\n" + script, context);
61-
NativeObject o = (NativeObject) engine.get("result");
62-
if (o != null) {
63-
for (Object o1 : o.getIds()) {
64-
String key = String.valueOf(o1);
65-
page.getResultItems().put(key, NativeObject.getProperty(o, key));
66-
}
67-
}
60+
// NativeObject o = (NativeObject) engine.get("result");
61+
// if (o != null) {
62+
// for (Object o1 : o.getIds()) {
63+
// String key = String.valueOf(o1);
64+
// page.getResultItems().put(key, NativeObject.getProperty(o, key));
65+
// }
66+
// }
6867
break;
6968
case JRuby:
7069
RubyHash oRuby = (RubyHash) engine.eval(defines + "\n" + script, context);

0 commit comments

Comments
 (0)