~ubuntu-branches/ubuntu/trusty/libv8/trusty

« back to all changes in this revision

Viewing changes to test/mjsunit/debug-scopes.js

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2012-02-20 14:08:17 UTC
  • mfrom: (15.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20120220140817-bsvmeoa4sxsj5hbz
Tags: 3.7.12.22-3
Fix mipsel build, allow test debug-step-3 to fail (non-crucial)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2008 the V8 project authors. All rights reserved.
 
1
// Copyright 2011 the V8 project authors. All rights reserved.
2
2
// Redistribution and use in source and binary forms, with or without
3
3
// modification, are permitted provided that the following conditions are
4
4
// met:
25
25
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
26
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
27
 
28
 
// Flags: --expose-debug-as debug
 
28
// Flags: --expose-debug-as debug --allow-natives-syntax
29
29
// The functions used for testing backtraces. They are at the top to make the
30
30
// testing of source line/column easier.
31
31
 
32
 
 
33
32
// Get the Debug object exposed from the debug context global object.
34
 
Debug = debug.Debug;
 
33
var Debug = debug.Debug;
35
34
 
36
35
var test_name;
37
36
var listener_delegate;
439
438
EndTest();
440
439
 
441
440
 
 
441
// With block in function that is marked for optimization while being executed.
 
442
BeginTest("With 7");
 
443
 
 
444
function with_7() {
 
445
  with({}) {
 
446
    %OptimizeFunctionOnNextCall(with_7);
 
447
    debugger;
 
448
  }
 
449
}
 
450
 
 
451
listener_delegate = function(exec_state) {
 
452
  CheckScopeChain([debug.ScopeType.With,
 
453
                   debug.ScopeType.Local,
 
454
                   debug.ScopeType.Global], exec_state);
 
455
  CheckScopeContent({}, 0, exec_state);
 
456
};
 
457
with_7();
 
458
EndTest();
 
459
 
 
460
 
442
461
// Simple closure formed by returning an inner function referering the outer
443
462
// functions arguments.
444
463
BeginTest("Closure 1");
950
969
EndTest();
951
970
 
952
971
 
 
972
// Catch block in function that is marked for optimization while being executed.
 
973
BeginTest("Catch block 7");
 
974
function catch_block_7() {
 
975
  %OptimizeFunctionOnNextCall(catch_block_7);
 
976
  try {
 
977
    throw 'Exception';
 
978
  } catch (e) {
 
979
    debugger;
 
980
  }
 
981
};
 
982
 
 
983
 
 
984
listener_delegate = function(exec_state) {
 
985
  CheckScopeChain([debug.ScopeType.Catch,
 
986
                   debug.ScopeType.Local,
 
987
                   debug.ScopeType.Global], exec_state);
 
988
  CheckScopeContent({e:'Exception'}, 0, exec_state);
 
989
};
 
990
catch_block_7();
 
991
EndTest();
 
992
 
 
993
 
953
994
assertEquals(begin_test_count, break_count,
954
995
             'one or more tests did not enter the debugger');
955
996
assertEquals(begin_test_count, end_test_count,