2019-01-14 11:54:31 +00:00
|
|
|
// Copyright 2019 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.
|
|
|
|
|
2019-01-25 11:45:28 +00:00
|
|
|
assertThrows(`
|
2019-01-14 11:54:31 +00:00
|
|
|
{
|
|
|
|
function a() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2019-01-25 11:45:28 +00:00
|
|
|
// Duplicate lexical declarations are only allowed if they are both sloppy
|
|
|
|
// block functions (see bug 4693). In this case the sloppy block function
|
|
|
|
// conflicts with the lexical variable declaration, causing a syntax error.
|
2019-01-14 11:54:31 +00:00
|
|
|
let a;
|
|
|
|
function a() {};
|
|
|
|
}
|
2019-01-25 11:45:28 +00:00
|
|
|
`, SyntaxError)
|