angular-docs-cn/tools/js2dart/spec/equals_spec.js

17 lines
308 B
JavaScript
Raw Normal View History

2014-09-25 17:30:10 -04:00
function same(a, b) {
return a === b;
}
2014-09-25 19:53:32 -04:00
function notSame(a, b) {
if ((a !== a) && (b !== b)) return true;
return a !== b;
}
2014-09-25 17:30:10 -04:00
function main() {
var obj = {};
assert(same({}, {}) == false);
assert(same(obj, obj) == true);
2014-09-25 19:53:32 -04:00
assert(notSame({}, {}) == true);
assert(notSame(obj, obj) == false);
2014-09-25 17:30:10 -04:00
}