allow the scope to be passed in, so we can support narwhal more easily
[rhinodom.git] / com / metaweb / util / javascript / DOM / JSComment.java
blob09bbaa260a525d917304b823fecb92a87ede4c7b
1 package com.metaweb.util.javascript.DOM;
3 import org.mozilla.javascript.Context;
4 import org.mozilla.javascript.Function;
5 import org.mozilla.javascript.Scriptable;
6 import org.mozilla.javascript.ScriptableObject;
7 import org.w3c.dom.Comment;
9 public class JSComment extends JSCharacterData {
11 private static final long serialVersionUID = 3986856046009222637L;
13 public JSComment() { }
15 public JSComment(Comment comment, Scriptable scope) {
16 _wrapped = comment;
17 _scope = scope;
20 public static Scriptable jsConstructor(Context cx, Object[] args, Function ctorObj, boolean inNewExpr) {
21 Scriptable scope = ScriptableObject.getTopLevelScope(ctorObj);
22 return new JSComment(((JSComment)args[1]).getWrapped(), (Scriptable)args[0]);
25 public String getClassName() {
26 return "Comment";
29 public Comment getWrapped() {
30 return ((Comment)_wrapped);