bug_OS15679026.js 1.0 KB

1234567891011121314151617181920212223242526
  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. WScript.LoadScriptFile("..\\UnitTestFramework\\UnitTestFramework.js");
  6. var tests = [
  7. {
  8. name: "Class which extends null won't assert when we do super property references",
  9. body: function () {
  10. class c extends null {
  11. constructor() {
  12. return {}
  13. }
  14. meth() {
  15. super['prop'] = 'something';
  16. super.prop = 'something'
  17. }
  18. }
  19. assert.throws(()=>c.prototype.meth.call({}), TypeError, "This shouldn't crash but does throw a TypeError", "Unable to set property 'prop' of undefined or null reference");
  20. }
  21. },
  22. ];
  23. testRunner.runTests(tests, { verbose: WScript.Arguments[0] != "summary" });