-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6bc527
commit c6e0b26
Showing
8 changed files
with
84 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// test_new.js | ||
// ----------- | ||
// Adapted from v8/test/mjsunit/new.js | ||
|
||
var assert = console.assert; | ||
|
||
function Construct(x) { return x; } | ||
|
||
assert(null != new Construct(null)); | ||
assert(void 0 != new Construct(void 0)); | ||
assert(0 != new Construct(0)); | ||
assert(1 != new Construct(1)); | ||
assert(4.2 != new Construct(4.2)); | ||
assert('foo' != new Construct('foo')); | ||
assert(true != new Construct(true)); | ||
|
||
x = {}; | ||
assert(x === new Construct(x)); | ||
assert(x !== new Construct(null)); | ||
assert(x !== new Construct(void 0)); | ||
assert(x !== new Construct(1)); | ||
assert(x !== new Construct(3.2)); | ||
assert(x !== new Construct(false)); | ||
assert(x !== new Construct('bar')); | ||
|
||
x = []; | ||
assert(x === new Construct(x)); | ||
x = new Boolean(true); | ||
assert(x === new Construct(x)); | ||
x = new Number(42); | ||
assert(x === new Construct(x)); | ||
x = new String('foo'); | ||
assert(x === new Construct(x)); | ||
x = function() { }; | ||
assert(x === new Construct(x)); |