exceptionInErrorToString.js 719 B

123456789101112
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
  4. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  5. //-------------------------------------------------------------------------------------------------------
  6. // Print sensible output for crashing when Error.toString is overwritten
  7. // See https://github.com/chakra-core/ChakraCore/issues/6567 for more detail
  8. ReferenceError.prototype.toString = function ( ) { print("CALLED toString"); return { toString () { return "hi"}};}
  9. a.b();