(object, prop, descriptor)
| 95 | $h_once.stringifyJson(stringifyJson);const{defineProperty:originalDefineProperty}=Object; |
| 96 | |
| 97 | const defineProperty= (object, prop, descriptor)=> { |
| 98 | // We used to do the following, until we had to reopen Safari bug |
| 99 | // https://bugs.webkit.org/show_bug.cgi?id=222538#c17 |
| 100 | // Once this is fixed, we may restore it. |
| 101 | // // Object.defineProperty is allowed to fail silently so we use |
| 102 | // // Object.defineProperties instead. |
| 103 | // return defineProperties(object, { [prop]: descriptor }); |
| 104 | |
| 105 | // Instead, to workaround the Safari bug |
| 106 | const result= originalDefineProperty(object, prop, descriptor); |
| 107 | if( result!== object) { |
| 108 | // See https://github.com/endojs/endo/blob/master/packages/ses/error-codes/SES_DEFINE_PROPERTY_FAILED_SILENTLY.md |
| 109 | throw TypeError( |
| 110 | `Please report that the original defineProperty silently failed to set ${stringifyJson( |
| 111 | String(prop)) |
| 112 | }. (SES_DEFINE_PROPERTY_FAILED_SILENTLY)`); |
| 113 | |
| 114 | } |
| 115 | return result; |
| 116 | };$h_once.defineProperty(defineProperty); |
| 117 | |
| 118 | const { |
| 119 | apply, |
no outgoing calls
no test coverage detected