Commit 84145803 authored by neis's avatar neis Committed by Commit bot

[modules] Add tests for the name property of default-exported functions.

R=adamk@chromium.org
BUG=v8:1569

Review-Url: https://codereview.chromium.org/2372873002
Cr-Commit-Position: refs/heads/master@{#39746}
parent 9f5ef0a4
// Copyright 2016 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.
//
// MODULE
import {default as goo} from "modules-skip-default-name1.js";
assertEquals(
{value: "gaga", configurable: true, writable: false, enumerable: false},
Reflect.getOwnPropertyDescriptor(goo, 'name'));
// Copyright 2016 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.
//
// MODULE
import {default as goo} from "modules-skip-default-name2.js";
assertEquals(
{value: "gaga", configurable: true, writable: false, enumerable: false},
Reflect.getOwnPropertyDescriptor(goo, 'name'));
// Copyright 2016 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.
//
// MODULE
import {default as goo} from "modules-skip-default-name3.js";
assertEquals(
{value: "default", configurable: true, writable: false, enumerable: false},
Reflect.getOwnPropertyDescriptor(goo, 'name'));
// Copyright 2016 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.
//
// MODULE
import {default as goo} from "modules-skip-default-name4.js";
assertEquals(
{value: "Gaga", configurable: true, writable: false, enumerable: false},
Reflect.getOwnPropertyDescriptor(goo, 'name'));
// Copyright 2016 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.
//
// MODULE
import {default as goo} from "modules-skip-default-name5.js";
assertEquals(
{value: "Gaga", configurable: true, writable: false, enumerable: false},
Reflect.getOwnPropertyDescriptor(goo, 'name'));
// Copyright 2016 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.
//
// MODULE
import {default as goo} from "modules-skip-default-name6.js";
assertEquals(
{value: "default", configurable: true, writable: false, enumerable: false},
Reflect.getOwnPropertyDescriptor(goo, 'name'));
// Copyright 2016 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.
//
// MODULE
import {default as goo} from "modules-skip-default-name7.js";
let descr = Reflect.getOwnPropertyDescriptor(goo, 'name');
assertEquals(descr,
{value: descr.value, configurable: true, writable: true, enumerable: false});
assertEquals("yo", descr.value());
// Copyright 2016 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.
//
// MODULE
import {default as goo} from "modules-skip-default-name8.js";
assertEquals(
{value: "default", configurable: true, writable: false, enumerable: false},
Reflect.getOwnPropertyDescriptor(goo, 'name'));
// Copyright 2016 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.
//
// MODULE
import {default as goo} from "modules-skip-default-name9.js";
assertEquals(
{value: "default", configurable: true, writable: false, enumerable: false},
Reflect.getOwnPropertyDescriptor(goo, 'name'));
// Copyright 2016 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.
export default function gaga() {}
// Copyright 2016 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.
export default (function gaga() {})
// Copyright 2016 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.
export default (function () {})
// Copyright 2016 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.
export default class Gaga { }
// Copyright 2016 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.
export default (class Gaga { })
// Copyright 2016 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.
export default (class { })
// Copyright 2016 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.
export default (class { static name() {return "yo"} })
// Copyright 2016 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.
export default function() { }
// Copyright 2016 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.
export default class { }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment