This file contains hidden or 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
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
This file contains hidden or 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 is the same gist but after edited it |
This file contains hidden or 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
// * @description: transferring to the String objects; | |
//CHECK#1 | |
try{ | |
var s1 = new String(); | |
s1.toString = Boolean.prototype.toString; | |
var v1 = s1.toString(); | |
$ERROR('#1: Boolean.prototype.toString on not a Boolean object should throw TypeError'); | |
} |
This file contains hidden or 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
var __re = new RegExp(x,"g"); | |
var __instance = String("asdf"); | |
var __str = "1"; | |
////////////////////////////////////////////////////////////////////////////// | |
//CHECK#1 |
This file contains hidden or 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
"use strict" | |
var __instance = new Number(100111122133144155); | |
Number.prototype.split = String.prototype.split; | |
var __split = __instance.split(1); | |
var __expected = ["","00","","","","22","33","44","60"]; |
This file contains hidden or 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
"use strict" | |
var __obj = { | |
valueOf:function(){}, | |
toString:void 0 | |
}; | |
var __split = new String(__obj).split(function(){}()); | |
if (__split.length !== 2) { |
This file contains hidden or 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
//15.5.4.17 String.prototype.toLocaleLowerCase ( ) | |
// This function works exactly the same as toLowerCase except that its result is intended to | |
// yield the correct result for the host environment’s current locale, rather | |
// than a locale independent result. | |
////////////////////////////////////////////////////////////////////////////// | |
//CHECK#1 | |
if (String.prototype.toLocaleUpperCase.length !== 0) { |
This file contains hidden or 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
// Running sputniktests from the command line. | |
$> ./tools/sputnik.py --command ~/gsoc/2010/besen/shell/BESENShellLinux386 | |
Traceback (most recent call last): | |
File "./tools/sputnik.py", line 515, in <module> | |
Main() | |
File "./tools/sputnik.py", line 510, in Main | |
options.full_summary) | |
File "./tools/sputnik.py", line 412, in Run |
This file contains hidden or 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
//CHECK#1 | |
try { | |
var x = []; | |
x.length = NaN; | |
$ERROR('#1.1: x = []; x.length = NaN throw RangeError. Actual: x.length === ' + (x.length)); | |
} catch(e) { | |
if ((e instanceof RangeError) !== true) { | |
$ERROR('#1.2: x = []; x.length = NaN throw RangeError. Actual: ' + (e)); | |
} | |
} |
This file contains hidden or 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
Array.prototype[1] = 1; | |
var x = [0]; | |
x.length = 2; | |
var arr = x.concat(); | |
//CHECK#1 | |
if (arr[0] !== 0) { | |
$ERROR('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; var arr = x.concat(); arr[0] === 0. Actual: ' + (arr[0])); | |
} |