(ExecutionContext context, Object self, Object... args)
| 16 | } |
| 17 | |
| 18 | @Override |
| 19 | public Object call(ExecutionContext context, Object self, Object... args) { |
| 20 | // 15.2.3.14 |
| 21 | Object o = args[0]; |
| 22 | |
| 23 | if (!(o instanceof JSObject)) { |
| 24 | throw new ThrowException(context, context.createTypeError("must be an object")); |
| 25 | } |
| 26 | |
| 27 | JSObject jsObj = (JSObject) o; |
| 28 | |
| 29 | JSObject array = BuiltinArray.newArray(context); |
| 30 | |
| 31 | int i = 0; |
| 32 | NameEnumerator names = jsObj.getOwnEnumerablePropertyNames(); |
| 33 | while (names.hasNext()) { |
| 34 | final String name = names.next(); |
| 35 | array.defineOwnProperty(context, "" + i, |
| 36 | PropertyDescriptor.newDataPropertyDescriptor(name, true, true, true), false); |
| 37 | ++i; |
| 38 | } |
| 39 | return array; |
| 40 | } |
| 41 | } |
nothing calls this directly
no test coverage detected