forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
105 additions
and
8 deletions.
There are no files selected for viewing
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
js/src/tests/test/expected/export/reftest-and-frontmatter-error.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (C) 2017 Mozilla Corporation. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
|
||
/*--- | ||
esid: sec-let-and-const-declarations | ||
features: [] | ||
negative: | ||
phase: runtime | ||
type: SyntaxError | ||
description: | | ||
Outside AsyncFunction, |await| is a perfectly cromulent LexicalDeclaration variable | ||
name. Therefore ASI doesn't apply, and so the |0| where a |=| was expected is a | ||
syntax error. | ||
---*/ | ||
|
||
eval(` | ||
function f() { | ||
let | ||
await 0; | ||
} | ||
`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// not an empty file |
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
js/src/tests/test/fixtures/export/reftest-and-frontmatter-error.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// |reftest| error:SyntaxError | ||
|
||
/*--- | ||
esid: sec-let-and-const-declarations | ||
description: > | ||
Outside AsyncFunction, |await| is a perfectly cromulent LexicalDeclaration | ||
variable name. Therefore ASI doesn't apply, and so the |0| where a |=| was | ||
expected is a syntax error. | ||
negative: | ||
phase: runtime | ||
type: SyntaxError | ||
---*/ | ||
|
||
eval(` | ||
function f() { | ||
let | ||
await 0; | ||
} | ||
`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// not an empty file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env python | ||
# Adapted from https://github.com/tc39/test262/blob/master/tools/generation/test/run.py | ||
|
||
import shutil, subprocess, sys, os, unittest | ||
|
||
testDir = os.path.dirname(os.path.relpath(__file__)) | ||
OUT_DIR = os.path.join(testDir, 'out') | ||
EXPECTED_DIR = os.path.join(testDir, 'expected') | ||
ex = os.path.join(testDir, '..', 'test262-export.py') | ||
|
||
class TestExport(unittest.TestCase): | ||
maxDiff = None | ||
|
||
def fixture(self, name): | ||
relpath = os.path.relpath(os.path.join(testDir, 'fixtures', name)) | ||
sp = subprocess.Popen( | ||
[ex, relpath, '--out', OUT_DIR], | ||
stdout=subprocess.PIPE) | ||
stdout, stderr = sp.communicate() | ||
return dict(stdout=stdout, stderr=stderr, returncode=sp.returncode) | ||
|
||
def getFiles(self, path): | ||
names = [] | ||
for root, _, fileNames in os.walk(path): | ||
for fileName in filter(lambda x: x[0] != '.', fileNames): | ||
names.append(os.path.join(root, fileName)) | ||
names.sort() | ||
return names | ||
|
||
def compareTrees(self, targetName): | ||
expectedPath = os.path.join(EXPECTED_DIR, targetName) | ||
actualPath = OUT_DIR | ||
|
||
expectedFiles = self.getFiles(expectedPath) | ||
actualFiles = self.getFiles(actualPath) | ||
|
||
self.assertListEqual( | ||
map(lambda x: os.path.relpath(x, expectedPath), expectedFiles), | ||
map(lambda x: os.path.relpath(x, actualPath), actualFiles)) | ||
|
||
for expectedFile, actualFile in zip(expectedFiles, actualFiles): | ||
with open(expectedFile) as expectedHandle: | ||
with open(actualFile) as actualHandle: | ||
self.assertMultiLineEqual( | ||
expectedHandle.read(), | ||
actualHandle.read()) | ||
|
||
def tearDown(self): | ||
shutil.rmtree(OUT_DIR, ignore_errors=True) | ||
|
||
def test_export(self): | ||
result = self.fixture('export') | ||
self.assertEqual(result['returncode'], 0) | ||
self.compareTrees('export') | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
Empty file.
Empty file.