-
Notifications
You must be signed in to change notification settings - Fork 31
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
Showing
11 changed files
with
107 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Index: inherits/inherits.js | ||
=================================================================== | ||
--- inherits/inherits.js | ||
+++ inherits/inherits.js | ||
@@ -1,1 +1,23 @@ | ||
-module.exports = require('util').inherits | ||
+if (typeof Object.create === 'function') { | ||
+ // implementation from standard node.js 'util' module | ||
+ module.exports = function inherits(ctor, superCtor) { | ||
+ ctor.super_ = superCtor | ||
+ ctor.prototype = Object.create(superCtor.prototype, { | ||
+ constructor: { | ||
+ value: ctor, | ||
+ enumerable: false, | ||
+ writable: true, | ||
+ configurable: true | ||
+ } | ||
+ }); | ||
+ }; | ||
+} else { | ||
+ // old school shim for old browsers | ||
+ module.exports = function inherits(ctor, superCtor) { | ||
+ ctor.super_ = superCtor | ||
+ var TempCtor = function () {} | ||
+ TempCtor.prototype = superCtor.prototype | ||
+ ctor.prototype = new TempCtor() | ||
+ ctor.prototype.constructor = ctor | ||
+ } | ||
+} |
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 @@ | ||
Index: util/util.js | ||
=================================================================== | ||
--- util/util.js | ||
+++ util/util.js | ||
@@ -347,9 +347,9 @@ | ||
|
||
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { | ||
var output = []; | ||
for (var i = 0, l = value.length; i < l; ++i) { | ||
- if (hasOwnProperty(value, String(i))) { | ||
+ if (_hasOwnProperty(value, String(i))) { | ||
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, | ||
String(i), true)); | ||
} else { | ||
output.push(''); | ||
@@ -378,9 +378,9 @@ | ||
if (desc.set) { | ||
str = ctx.stylize('[Setter]', 'special'); | ||
} | ||
} | ||
- if (!hasOwnProperty(visibleKeys, key)) { | ||
+ if (!_hasOwnProperty(visibleKeys, key)) { | ||
name = '[' + key + ']'; | ||
} | ||
if (!str) { | ||
if (ctx.seen.indexOf(desc.value) < 0) { | ||
@@ -580,7 +580,7 @@ | ||
} | ||
return origin; | ||
}; | ||
|
||
-function hasOwnProperty(obj, prop) { | ||
+function _hasOwnProperty(obj, prop) { | ||
return Object.prototype.hasOwnProperty.call(obj, prop); | ||
} |
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,20 @@ | ||
import QtQuick 2.3 | ||
import QtTest 1.0 | ||
import Quickly 0.1 | ||
|
||
TestCase { | ||
name: "AssertTests" | ||
|
||
function test_assert_ok_when_true() { | ||
Assert.ok(true) | ||
} | ||
|
||
function test_assert_ok_when_false_throws_exception() { | ||
try { | ||
Assert.fail(true) | ||
fail("An error should have been thrown!") | ||
} catch (error) { | ||
// Do nothing | ||
} | ||
} | ||
} |
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