1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.javascript;
16
17 import java.io.Serializable;
18
19 import org.htmlunit.corejs.javascript.Context;
20 import org.htmlunit.corejs.javascript.Function;
21 import org.htmlunit.corejs.javascript.Scriptable;
22 import org.htmlunit.corejs.javascript.Symbol;
23 import org.htmlunit.corejs.javascript.SymbolScriptable;
24 import org.htmlunit.corejs.javascript.VarScope;
25
26
27
28
29
30
31
32
33
34 public class FunctionWrapper implements Function, SymbolScriptable, Serializable {
35 private final Function wrapped_;
36
37
38
39
40
41 public FunctionWrapper(final Function wrapped) {
42 wrapped_ = wrapped;
43 }
44
45
46
47
48 @Override
49 public Object call(final Context cx, final VarScope scope, final Scriptable thisObj, final Object[] args) {
50 return wrapped_.call(cx, scope, thisObj, args);
51 }
52
53
54
55
56 @Override
57 public String getClassName() {
58 return wrapped_.getClassName();
59 }
60
61
62
63
64 @Override
65 public Scriptable construct(final Context cx, final VarScope scope, final Object[] args) {
66 return wrapped_.construct(cx, scope, args);
67 }
68
69
70
71
72 @Override
73 public Object get(final String name, final Scriptable start) {
74 return wrapped_.get(name, start);
75 }
76
77
78
79
80 @Override
81 public Object get(final int index, final Scriptable start) {
82 return wrapped_.get(index, start);
83 }
84
85
86
87
88 @Override
89 public Object get(final Symbol key, final Scriptable start) {
90 return ((SymbolScriptable) wrapped_).get(key, start);
91 }
92
93
94
95
96 @Override
97 public boolean has(final String name, final Scriptable start) {
98 return wrapped_.has(name, start);
99 }
100
101
102
103
104 @Override
105 public boolean has(final int index, final Scriptable start) {
106 return wrapped_.has(index, start);
107 }
108
109
110
111
112 @Override
113 public boolean has(final Symbol key, final Scriptable start) {
114 return ((SymbolScriptable) wrapped_).has(key, start);
115 }
116
117
118
119
120 @Override
121 public void put(final String name, final Scriptable start, final Object value) {
122 wrapped_.put(name, wrapped_, value);
123 }
124
125
126
127
128 @Override
129 public void put(final int index, final Scriptable start, final Object value) {
130 wrapped_.put(index, wrapped_, value);
131 }
132
133
134
135
136 @Override
137 public void put(final Symbol key, final Scriptable start, final Object value) {
138 ((SymbolScriptable) wrapped_).put(key, wrapped_, value);
139 }
140
141
142
143
144 @Override
145 public void delete(final String name) {
146 wrapped_.delete(name);
147 }
148
149
150
151
152 @Override
153 public void delete(final int index) {
154 wrapped_.delete(index);
155 }
156
157
158
159
160 @Override
161 public void delete(final Symbol key) {
162 ((SymbolScriptable) wrapped_).delete(key);
163 }
164
165
166
167
168 @Override
169 public Scriptable getPrototype() {
170 return wrapped_.getPrototype();
171 }
172
173
174
175
176 @Override
177 public void setPrototype(final Scriptable prototype) {
178 wrapped_.setPrototype(prototype);
179 }
180
181
182
183
184 @Override
185 public VarScope getParentScope() {
186 return wrapped_.getParentScope();
187 }
188
189
190
191
192 @Override
193 public void setParentScope(final VarScope scope) {
194 wrapped_.setParentScope(scope);
195 }
196
197
198
199
200 @Override
201 public Object[] getIds() {
202 return wrapped_.getIds();
203 }
204
205
206
207
208 @Override
209 public Object getDefaultValue(final Class<?> hint) {
210 return wrapped_.getDefaultValue(hint);
211 }
212
213
214
215
216 @Override
217 public boolean hasInstance(final Scriptable instance) {
218 return wrapped_.hasInstance(instance);
219 }
220 }