regress-crbug-424142.js 976 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
// Copyright 2014 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.


(function outer() {
  var C = (function C_() {
    var y = 1;
    function CC() {
      this.x = 0;
    }
    CC.prototype.f = function CCf() {
      this.x += y;
      return this.x;
    };
    return CC;
  })();

  var c = new C(0);
})

function sentinel() {}

Debug = debug.Debug;
25
Debug.setListener(function(){});
26 27

var script = Debug.findScript(sentinel);
28
var line = 13;
29 30 31 32 33 34 35 36
var line_start = Debug.findScriptSourcePosition(script, line, 0);
var line_end = Debug.findScriptSourcePosition(script, line + 1, 0) - 1;
var actual = Debug.setBreakPointByScriptIdAndPosition(
                 script.id, line_start).actual_position;
// Make sure the actual break position is within the line where we set
// the break point.
assertTrue(line_start <= actual);
assertTrue(actual <= line_end);
37 38

Debug.setListener(null);