nullPropertyDescriptor.js 656 B

123456789101112131415161718
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. try {
  6. Object.defineProperty({}, "x", null);
  7. } catch (e) {
  8. if (e instanceof TypeError) {
  9. if (e.message !== "Invalid descriptor for property 'x'") {
  10. print('FAIL');
  11. } else {
  12. print('PASS');
  13. }
  14. } else {
  15. print('FAIL');
  16. }
  17. }