1 // Copyright 2016 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 Error.prepareStackTrace = function(e, frames) { return frames; } 6 assertThrows(() => new Error().stack[0].getMethodName.call({}), TypeError); 7 8 Error.prepareStackTrace = function(e, frames) { return frames.map(frame => new Proxy(frame, {})); } 9 assertThrows(() => new Error().stack[0].getMethodName(), TypeError); 10 11 Error.prepareStackTrace = function(e, frames) { return frames; } 12 assertEquals(null, new Error().stack[0].getMethodName()); 13