~ubuntu-branches/ubuntu/trusty/mozjs17/trusty

« back to all changes in this revision

Viewing changes to js/src/jit-test/tests/debug/Frame-this-01.js

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Frame.prototype.this in strict-mode functions, with primitive values
 
2
 
 
3
var g = newGlobal('new-compartment');
 
4
var dbg = new Debugger(g);
 
5
var hits = 0;
 
6
dbg.onDebuggerStatement = function (frame) {
 
7
    hits++;
 
8
    assertEq(frame.this, g.v);
 
9
};
 
10
 
 
11
g.eval("function f() { 'use strict'; debugger; }");
 
12
 
 
13
g.eval("Boolean.prototype.f = f; v = true; v.f();");
 
14
g.eval("f.call(v);");
 
15
g.eval("Number.prototype.f = f; v = 3.14; v.f();");
 
16
g.eval("f.call(v);");
 
17
g.eval("String.prototype.f = f; v = 'hello'; v.f();");
 
18
g.eval("f.call(v);");
 
19
g.eval("v = undefined; f.call(v);");
 
20
g.eval("v = null; f.call(v);");
 
21
 
 
22
assertEq(hits, 8);