Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Side by Side Diff: test/mjsunit/regress/regress-crbug-109362.js

Issue 1053563002: Revert of Correctly compute line numbers in functions from the function constructor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added regression test Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/message/single-function-literal.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 function test(expectation, f) { 6 function test(expectation, f) {
7 var stack; 7 var stack;
8 try { 8 try {
9 f(); 9 f();
10 } catch (e) { 10 } catch (e) {
11 stack = e.stack; 11 stack = e.stack;
12 } 12 }
13 print(stack);
14 assertTrue(stack.indexOf("at eval (evaltest:" + expectation + ")") > 0); 13 assertTrue(stack.indexOf("at eval (evaltest:" + expectation + ")") > 0);
15 } 14 }
16 15
17 test("1:5", new Function( 16 /*
17 (function() {
18 1 + reference_error //@ sourceURL=evaltest
19 })
20 */
21 test("2:5", new Function(
18 '1 + reference_error //@ sourceURL=evaltest')); 22 '1 + reference_error //@ sourceURL=evaltest'));
19 test("2:6", new Function( 23 /*
24 (function(x
25 /\**\/) {
26
27 1 + reference_error //@ sourceURL=evaltest
28 })
29 */
30 test("4:6", new Function(
20 'x', '\n 1 + reference_error //@ sourceURL=evaltest')); 31 'x', '\n 1 + reference_error //@ sourceURL=evaltest'));
21 test("2:6", new Function( 32 /*
33 (function(x
34
35 ,z//
36 ,y
37 /\**\/) {
38
39 1 + reference_error //@ sourceURL=evaltest
40 })
41 */
42 test("7:6", new Function(
22 'x\n\n', "z//\n", "y", '\n 1 + reference_error //@ sourceURL=evaltest')); 43 'x\n\n', "z//\n", "y", '\n 1 + reference_error //@ sourceURL=evaltest'));
23 test("1:5", new Function( 44 /*
45 (function(x/\*,z//
46 ,y*\/
47 /\**\/) {
48 1 + reference_error //@ sourceURL=evaltest
49 })
50 */
51 test("4:5", new Function(
24 'x/*', "z//\n", "y*/", '1 + reference_error //@ sourceURL=evaltest')); 52 'x/*', "z//\n", "y*/", '1 + reference_error //@ sourceURL=evaltest'));
53 /*
54 (function () {
55 1 + reference_error //@ sourceURL=evaltest5
56 })
57 */
25 test("2:6", eval( 58 test("2:6", eval(
26 '(function () {\n 1 + reference_error //@ sourceURL=evaltest\n})')); 59 '(function () {\n 1 + reference_error //@ sourceURL=evaltest\n})'));
OLDNEW
« no previous file with comments | « test/message/single-function-literal.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698