479
480 /**
481 * Return the __proto__ of this object.
482 * @return __proto__ object.
483 */
484 public Object getProto() {
485 return inGlobal(new Callable<Object>() {
486 @Override public Object call() {
487 return wrap(sobj.getProto(), global);
488 }
489 });
490 }
491
492 /**
493 * Set the __proto__ of this object.
494 * @param proto new proto for this object
495 */
496 public void setProto(final Object proto) {
497 inGlobal(new Callable<Void>() {
498 @Override public Void call() {
499 sobj.setProtoCheck(unwrap(proto, global));
500 return null;
501 }
502 });
503 }
504
505 /**
506 * ECMA 8.12.1 [[GetOwnProperty]] (P)
507 *
508 * @param key property key
509 *
510 * @return Returns the Property Descriptor of the named own property of this
511 * object, or undefined if absent.
512 */
513 public Object getOwnPropertyDescriptor(final String key) {
514 return inGlobal(new Callable<Object>() {
515 @Override public Object call() {
516 return wrap(sobj.getOwnPropertyDescriptor(key), global);
517 }
518 });
519 }
|
479
480 /**
481 * Return the __proto__ of this object.
482 * @return __proto__ object.
483 */
484 public Object getProto() {
485 return inGlobal(new Callable<Object>() {
486 @Override public Object call() {
487 return wrap(sobj.getProto(), global);
488 }
489 });
490 }
491
492 /**
493 * Set the __proto__ of this object.
494 * @param proto new proto for this object
495 */
496 public void setProto(final Object proto) {
497 inGlobal(new Callable<Void>() {
498 @Override public Void call() {
499 sobj.setPrototypeOf(unwrap(proto, global));
500 return null;
501 }
502 });
503 }
504
505 /**
506 * ECMA 8.12.1 [[GetOwnProperty]] (P)
507 *
508 * @param key property key
509 *
510 * @return Returns the Property Descriptor of the named own property of this
511 * object, or undefined if absent.
512 */
513 public Object getOwnPropertyDescriptor(final String key) {
514 return inGlobal(new Callable<Object>() {
515 @Override public Object call() {
516 return wrap(sobj.getOwnPropertyDescriptor(key), global);
517 }
518 });
519 }
|