// Copyright 2015 the V8 project authors. All rights reserved.// Use of this source code is governed by a BSD-style license that can be// found in the LICENSE file."use strict";functiongetTypeName(receiver){Error.prepareStackTrace=function(e,stack){returnstack;}varstack=(function(){returnnewError().stack;}).call(receiver);Error.prepareStackTrace=undefined;returnstack[0].getTypeName();}assertNull(getTypeName(undefined));assertNull(getTypeName(null));assertEquals("Number",getTypeName(1));assertEquals("String",getTypeName(""));assertEquals("Boolean",getTypeName(false));assertEquals("Object",getTypeName({}));assertEquals("Array",getTypeName([]));assertEquals("Custom",getTypeName(new(functionCustom(){})()));