obj-ptrn-id-get-value-err.js 1023 B

1234567891011121314151617181920212223242526272829303132333435
  1. // This file was procedurally generated from the following sources:
  2. // - src/dstr-binding/obj-ptrn-id-get-value-err.case
  3. // - src/dstr-binding/error/try.template
  4. /*---
  5. description: Error thrown when accessing the corresponding property of the value object (try statement)
  6. esid: sec-runtime-semantics-catchclauseevaluation
  7. features: [destructuring-binding]
  8. flags: [generated]
  9. info: |
  10. Catch : catch ( CatchParameter ) Block
  11. [...]
  12. 5. Let status be the result of performing BindingInitialization for
  13. CatchParameter passing thrownValue and catchEnv as arguments.
  14. [...]
  15. 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
  16. SingleNameBinding : BindingIdentifier Initializeropt
  17. [...]
  18. 4. Let v be GetV(value, propertyName).
  19. 5. ReturnIfAbrupt(v).
  20. ---*/
  21. var poisonedProperty = Object.defineProperty({}, 'poisoned', {
  22. get: function() {
  23. throw new Test262Error();
  24. }
  25. });
  26. assert.throws(Test262Error, function() {
  27. try {
  28. throw poisonedProperty;
  29. } catch ({ poisoned }) {}
  30. });