Debian Codegraph @

js/src/tests/test262/language/function-code/10.4.3-1-2-s.js

raw
1 // Copyright (c) 2012 Ecma International. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 es5id: 10.4.3-1-2-s
6 description: this is not coerced to an object in strict mode (string)
7 flags: [noStrict]
8 ---*/
9
10 function foo()
11 {
12 'use strict';
13 return typeof(this);
14 }
15
16 function bar()
17 {
18 return typeof(this);
19 }
20
21 assert.sameValue(foo.call('1'), 'string', 'foo.call("1")');
22 assert.sameValue(bar.call('1'), 'object', 'bar.call("1")');
23
24 reportCompare(0, 0);