test262/website/json/bestPractice.json

164 lines
18 KiB
JSON

{
"testsCollection":{
"name":"Chapter - bestPractice",
"numTests":"20",
"tests":[
{
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbiBkZWNsYXJhdGlvbiB3aXRoaW4gYW4gImlmIiBzdGF0ZW1lbnQgaXMgbm90IGFsbG93ZWQKICoKICogQHBhdGggYmVzdFByYWN0aWNlL1NicF8xMi41X0E5X1QzLmpzCiAqIEBkZXNjcmlwdGlvbiBEZWNsYXJpbmcgZnVuY3Rpb24gd2l0aGluIGFuICJpZiIgc3RhdGVtZW50IHRoYXQgaXMgZGVjbGFyZWQgd2l0aGluIHRoZSBmdW5jdGlvbiBkZWNsYXJhdGlvbgogKiBAbmVnYXRpdmUKICovCgpmdW5jdGlvbigpewoKaWYgKHRydWUpIHsKICAgIGZ1bmN0aW9uIF9fZnVuYygpe307Cn0gZWxzZSB7CiAgICBmdW5jdGlvbiBfX2Z1bmMoKXt9Owp9Cgp9OwoK",
"commentary":"Function declaration within an \"if\" statement is not allowed",
"description":"Declaring function within an \"if\" statement that is declared within the function declaration",
"negative":"",
"path":"TestCases/bestPractice/Sbp_12.5_A9_T3.js"
},
{
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbkRlY2xhcmF0aW9uIHdpdGhpbiBhICJkby13aGlsZSIgQmxvY2sgaXMgbm90IGFsbG93ZWQKICoKICogQHBhdGggYmVzdFByYWN0aWNlL1NicF8xMi42LjFfQTEzX1QzLmpzCiAqIEBkZXNjcmlwdGlvbiBEZWNsYXJpbmcgYSBmdW5jdGlvbiB3aXRoaW4gYSAiZG8td2hpbGUiIGxvb3AgdGhhdCBpcyB3aXRoaW4gYSBmdW5jdGlvbiBkZWNsYXJhdGlvbiBpdHNlbGYKICogQG5lZ2F0aXZlCiAqLwoKZnVuY3Rpb24oKXsKCmRvewogICAgZnVuY3Rpb24gX19mdW5jKCl7fTsKfXdoaWxlKDApOwoKfTsKCg==",
"commentary":"FunctionDeclaration within a \"do-while\" Block is not allowed",
"description":"Declaring a function within a \"do-while\" loop that is within a function declaration itself",
"negative":"",
"path":"TestCases/bestPractice/Sbp_12.6.1_A13_T3.js"
},
{
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbkRlY2xhcmF0aW9uIHdpdGhpbiBhICJ3aGlsZSIgU3RhdGVtZW50IGlzIG5vdCBhbGxvd2VkCiAqCiAqIEBwYXRoIGJlc3RQcmFjdGljZS9TYnBfMTIuNi4yX0ExM19UMy5qcwogKiBAZGVzY3JpcHRpb24gQ2hlY2tpbmcgaWYgZGVjbGFyaW5nIGEgZnVuY3Rpb24gd2l0aGluIGEgIndoaWxlIiBTdGF0ZW1lbnQgdGhhdCBpcyBpbiBhIGZ1bmN0aW9uIGJvZHkgbGVhZHMgdG8gYW4gZXhjZXB0aW9uCiAqIEBuZWdhdGl2ZQogKi8KCmZ1bmN0aW9uKCl7Cgp3aGlsZSgwKXsKICAgIGZ1bmN0aW9uIF9fZnVuYygpe307Cn07Cgp9OwoK",
"commentary":"FunctionDeclaration within a \"while\" Statement is not allowed",
"description":"Checking if declaring a function within a \"while\" Statement that is in a function body leads to an exception",
"negative":"",
"path":"TestCases/bestPractice/Sbp_12.6.2_A13_T3.js"
},
{
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbkRlY2xhcmF0aW9uIHdpdGhpbiBhICJmb3ItaW4iIFN0YXRlbWVudCBpcyBub3QgYWxsb3dlZAogKgogKiBAcGF0aCBiZXN0UHJhY3RpY2UvU2JwXzEyLjYuNF9BMTNfVDMuanMKICogQGRlc2NyaXB0aW9uIERlY2xhcmluZyBmdW5jdGlvbiB3aXRoaW4gYSAiZm9yLWluIiBTdGF0ZW1lbnQgdGhhdCBpcyB3aXRoaW4gZnVuY3Rpb24gZGVjbGFyYXRpb24KICogQG5lZ2F0aXZlCiAqLwoKZnVuY3Rpb24oKXsKCmZvcih4IGluIHRoaXMpewogICAgZnVuY3Rpb24gX19mdW5jKCl7fTsKfTsKCn07Cgo=",
"commentary":"FunctionDeclaration within a \"for-in\" Statement is not allowed",
"description":"Declaring function within a \"for-in\" Statement that is within function declaration",
"negative":"",
"path":"TestCases/bestPractice/Sbp_12.6.4_A13_T3.js"
},
{
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBFc2NhcGVTZXF1ZW5jZSA6OiBIZXhFc2NhcGVTZXF1ZW5jZSA6OiB4IEhleERpZ2l0IEhleERpZ2l0CiAqCiAqIEBwYXRoIGJlc3RQcmFjdGljZS9TYnBfNy44LjRfQTYuMV9UNC5qcwogKiBAZGVzY3JpcHRpb24gSGV4RXNjYXBlU2VxdWVuY2UgOjogeDBHIGlzIGluY29ycmVjdAogKiBAbmVnYXRpdmUKICovCgovL0NIRUNLIwoiXHgwRyIKCg==",
"commentary":"EscapeSequence :: HexEscapeSequence :: x HexDigit HexDigit",
"description":"HexEscapeSequence :: x0G is incorrect",
"negative":"",
"path":"TestCases/bestPractice/Sbp_7.8.4_A6.1_T4.js"
},
{
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBIZXhFc2NhcGVTZXF1ZW5jZSA6OiB4IEhleERpZ2l0IGlzIGluY29ycmVjdAogKgogKiBAcGF0aCBiZXN0UHJhY3RpY2UvU2JwXzcuOC40X0E2LjJfVDEuanMKICogQGRlc2NyaXB0aW9uIEhleERpZ2l0IDo6IDEKICogQG5lZ2F0aXZlCiAqLwoKLy9DSEVDSyMxCiJceDEiCgo=",
"commentary":"HexEscapeSequence :: x HexDigit is incorrect",
"description":"HexDigit :: 1",
"negative":"",
"path":"TestCases/bestPractice/Sbp_7.8.4_A6.2_T1.js"
},
{
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBIZXhFc2NhcGVTZXF1ZW5jZSA6OiB4IEhleERpZ2l0IGlzIGluY29ycmVjdAogKgogKiBAcGF0aCBiZXN0UHJhY3RpY2UvU2JwXzcuOC40X0E2LjJfVDIuanMKICogQGRlc2NyaXB0aW9uIEhleERpZ2l0IDo6IEEKICogQG5lZ2F0aXZlCiAqLwoKLy9DSEVDSyMxCiJceEEiCgo=",
"commentary":"HexEscapeSequence :: x HexDigit is incorrect",
"description":"HexDigit :: A",
"negative":"",
"path":"TestCases/bestPractice/Sbp_7.8.4_A6.2_T2.js"
},
{
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBDaGVjayBEby1XaGlsZSBTdGF0ZW1lbnQgZm9yIGF1dG9tYXRpYyBzZW1pY29sb24gaW5zZXJ0aW9uCiAqCiAqIEBwYXRoIGJlc3RQcmFjdGljZS9TYnBfNy45X0E5X1QzLmpzCiAqIEBkZXNjcmlwdGlvbiBFeGVjdXRlIGRvIHsgXG4gOyBcbiB9d2hpbGUoZmFsc2UpIHRydWUKICovCgovL0NIRUNLIzEKZG8gewogIDsKfSB3aGlsZSAoZmFsc2UpIHRydWUKCg==",
"commentary":"Check Do-While Statement for automatic semicolon insertion",
"description":"Execute do { \\n ; \\n }while(false) true",
"path":"TestCases/bestPractice/Sbp_7.9_A9_T3.js"
},
{
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBDaGVjayBEby1XaGlsZSBTdGF0ZW1lbnQgZm9yIGF1dG9tYXRpYyBzZW1pY29sb24gaW5zZXJ0aW9uCiAqCiAqIEBwYXRoIGJlc3RQcmFjdGljZS9TYnBfNy45X0E5X1Q0LmpzCiAqIEBkZXNjcmlwdGlvbiBFeGVjdXRlIGRvIDsgd2hpbGUgXG4gKGZhbHNlKSB0cnVlCiAqLwoKLy9DSEVDSyMxCmRvIDsgd2hpbGUgCihmYWxzZSkgdHJ1ZQoK",
"commentary":"Check Do-While Statement for automatic semicolon insertion",
"description":"Execute do ; while \\n (false) true",
"path":"TestCases/bestPractice/Sbp_7.9_A9_T4.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:make_non-standard_properties_configurable",
"code":"Ly8gQ29weXJpZ2h0IDIwMTEgR29vZ2xlIEluYy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBAcGF0aCBiZXN0UHJhY3RpY2UvU2JwX0ExMF9UMS5qcwogKiBAZGVzY3JpcHRpb24gQnVpbHQtaW4gZnVuY3Rpb25zIHNob3VsZCBub3QgaGF2ZSBhIG5vbi1kZWxldGFibGUsCiAqIG5vbi1wb2lzb25lZCAiY2FsbGVyIiBwcm9wZXJ0eS4KICogQGJlc3RQcmFjdGljZQogKiBodHRwOi8vd2lraS5lY21hc2NyaXB0Lm9yZy9kb2t1LnBocD9pZD1jb252ZW50aW9uczptYWtlX25vbi1zdGFuZGFyZF9wcm9wZXJ0aWVzX2NvbmZpZ3VyYWJsZQogKi8KCihmdW5jdGlvbigpIHsKICAgdmFyIG1hcCA9IEFycmF5LnByb3RvdHlwZS5tYXA7CiAgIGlmICghbWFwKSB7IHJldHVybjsgfQogICB0cnkgewogICAgIGRlbGV0ZSBtYXAuY2FsbGVyOwogICB9IGNhdGNoIChlcnIxKSB7CiAgICAgLy8gaWdub3JlCiAgIH0KICAgaWYgKCdjYWxsZXInIGluIG1hcCkgewogICAgIHRyeSB7CiAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkobWFwLCAnY2FsbGVyJywgewogICAgICAgICB3cml0YWJsZTogZmFsc2UsCiAgICAgICAgIGNvbmZpZ3VyYWJsZTogZmFsc2UKICAgICAgIH0pOwogICAgIH0gY2F0Y2ggKGVycjIpIHsKICAgICAgIC8vIGlnbm9yZQogICAgIH0KICAgfQoKICAgZnVuY3Rpb24gZm9vKG0pIHsgcmV0dXJuIG0uY2FsbGVyOyB9CiAgIGZ1bmN0aW9uIHRlc3RmbihhLCBmKSB7IHJldHVybiBhLm1hcChmKVswXTsgfQogICB2YXIgYSA9IFttYXBdOwogICB2YXIgY2FsbGVyOwogICB0cnkgewogICAgIGNhbGxlciA9IHRlc3RmbihhLCBmb28pOwogICB9IGNhdGNoIChlcnIzKSB7CiAgICAgaWYgKGVycjMgaW5zdGFuY2VvZiBUeXBlRXJyb3IpIHsgcmV0dXJuOyB9CiAgICAgJEVSUk9SKCcjMTogQnVpbHQtaW4gImNhbGxlciIgZmFpbGVkIHdpdGg6ICcgKyBlcnIzKTsKICAgfQogICBpZiAobnVsbCA9PT0gY2FsbGVyIHx8IHZvaWQgMCA9PT0gY2FsbGVyKSB7IHJldHVybjsgfQogICBpZiAodGVzdGZuID09PSBjYWxsZXIpIHsKICAgICAkRVJST1IoJyMyOiBCdWlsdC1pbiByZXZlYWxlZCBjYWxsZXInKTsKICAgfQogICAkRVJST1IoJyMzOiBVbmV4cGVjdGVkICJjYWxsZXIiOiAnICsgY2FsbGVyKTsKfSkoKTs=",
"commentary":"",
"description":"Built-in functions should not have a non-deletable,\nnon-poisoned \"caller\" property.",
"path":"TestCases/bestPractice/Sbp_A10_T1.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:make_non-standard_properties_configurable",
"code":"Ly8gQ29weXJpZ2h0IDIwMTEgR29vZ2xlIEluYy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBAcGF0aCBiZXN0UHJhY3RpY2UvU2JwX0ExMF9UMi5qcwogKiBAZGVzY3JpcHRpb24gQnVpbHQtaW4gZnVuY3Rpb25zIHNob3VsZCBub3QgaGF2ZSBhIG5vbi1kZWxldGFibGUsCiAqIG5vbi1wb2lzb25lZCAiYXJndW1lbnRzIiBwcm9wZXJ0eS4KICogQGJlc3RQcmFjdGljZQogKiBodHRwOi8vd2lraS5lY21hc2NyaXB0Lm9yZy9kb2t1LnBocD9pZD1jb252ZW50aW9uczptYWtlX25vbi1zdGFuZGFyZF9wcm9wZXJ0aWVzX2NvbmZpZ3VyYWJsZQogKi8KCihmdW5jdGlvbigpIHsKICAgdmFyIG1hcCA9IEFycmF5LnByb3RvdHlwZS5tYXA7CiAgIGlmICghbWFwKSB7IHJldHVybjsgfQogICB0cnkgewogICAgIGRlbGV0ZSBtYXAuYXJndW1lbnRzOwogICB9IGNhdGNoIChlcnIxKSB7CiAgICAgLy8gaWdub3JlCiAgIH0KICAgaWYgKCdhcmd1bWVudHMnIGluIG1hcCkgewogICAgIHRyeSB7CiAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkobWFwLCAnYXJndW1lbnRzJywgewogICAgICAgICB3cml0YWJsZTogZmFsc2UsCiAgICAgICAgIGNvbmZpZ3VyYWJsZTogZmFsc2UKICAgICAgIH0pOwogICAgIH0gY2F0Y2ggKGVycjIpIHsKICAgICAgIC8vIGlnbm9yZQogICAgIH0KICAgfQoKICAgZnVuY3Rpb24gZm9vKG0pIHsgcmV0dXJuIG0uYXJndW1lbnRzOyB9CiAgIGZ1bmN0aW9uIHRlc3RmbihhLCBmKSB7IHJldHVybiBhLm1hcChmKVswXTsgfQogICB2YXIgYSA9IFttYXBdOwogICB2YXIgYXJnczsKICAgdHJ5IHsKICAgICBhcmdzID0gdGVzdGZuKGEsIGZvbyk7CiAgIH0gY2F0Y2ggKGVycjMpIHsKICAgICBpZiAoZXJyMyBpbnN0YW5jZW9mIFR5cGVFcnJvcikgeyByZXR1cm47IH0KICAgICAkRVJST1IoJyMxOiBCdWlsdC1pbiAiYXJndW1lbnRzIiBmYWlsZWQgd2l0aDogJyArIGVycjMpOwogICB9CiAgIGlmIChudWxsID09PSBhcmdzIHx8IHZvaWQgMCA9PT0gYXJncykgeyByZXR1cm47IH0KICAgaWYgKHRlc3RmbiA9PT0gYXJncykgewogICAgICRFUlJPUignIzI6IEJ1aWx0LWluIHJldmVhbGVkIGFyZ3VtZW50cycpOwogICB9CiAgICRFUlJPUignIzM6IFVuZXhwZWN0ZWQgImFyZ3VtZW50cyI6ICcgKyBhcmdzKTsKfSkoKTsK",
"commentary":"",
"description":"Built-in functions should not have a non-deletable,\nnon-poisoned \"arguments\" property.",
"path":"TestCases/bestPractice/Sbp_A10_T2.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls",
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBUaGUgcHJvZHVjdGlvbiBCbG9jayB7IH0gaW4gc3RyaWN0IGNvZGUgY2FuJ3QgY29udGFpbiBmdW5jdGlvbgogKiBkZWNsYXJhdGlvbjsKICoKICogQHBhdGggYmVzdFByYWN0aWNlL1NicF9BMV9UMS5qcwogKiBAZGVzY3JpcHRpb24gVHJ5aW5nIHRvIGRlY2xhcmUgZnVuY3Rpb24gYXQgdGhlIEJsb2NrIHN0YXRlbWVudAogKiBAb25seVN0cmljdAogKiBAbmVnYXRpdmUgU3ludGF4RXJyb3IKICogQGJlc3RQcmFjdGljZSBodHRwOi8vd2lraS5lY21hc2NyaXB0Lm9yZy9kb2t1LnBocD9pZD1jb252ZW50aW9uczpub19ub25fc3RhbmRhcmRfc3RyaWN0X2RlY2xzCiAqLwoKInVzZSBzdHJpY3QiOwp7CiAgICBmdW5jdGlvbiBfX2Z1bmMoKXt9Cn0KCg==",
"commentary":"The production Block { } in strict code can't contain function\ndeclaration;",
"description":"Trying to declare function at the Block statement",
"negative":"SyntaxError",
"onlyStrict":"",
"path":"TestCases/bestPractice/Sbp_A1_T1.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls",
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbiBkZWNsYXJhdGlvbiB3aXRoaW4gYW4gImlmIiBzdGF0ZW1lbnQgaW4gc3RyaWN0IGNvZGUgaXMgbm90CiAqIGFsbG93ZWQKICoKICogQHBhdGggYmVzdFByYWN0aWNlL1NicF9BMl9UMS5qcwogKiBAZGVzY3JpcHRpb24gRGVjbGFyaW5nIGZ1bmN0aW9uIHdpdGhpbiBhIHN0cmljdCAiaWYiIHN0YXRlbWVudAogKiBAb25seVN0cmljdAogKiBAbmVnYXRpdmUgU3ludGF4RXJyb3IKICogQGJlc3RQcmFjdGljZSBodHRwOi8vd2lraS5lY21hc2NyaXB0Lm9yZy9kb2t1LnBocD9pZD1jb252ZW50aW9uczpub19ub25fc3RhbmRhcmRfc3RyaWN0X2RlY2xzCiAqLwoKInVzZSBzdHJpY3QiOwppZiAodHJ1ZSkgewogICAgZnVuY3Rpb24gX19mdW5jKCl7fTsKfSBlbHNlIHsKICAgIGZ1bmN0aW9uIF9fZnVuYygpe307Cn0KCg==",
"commentary":"Function declaration within an \"if\" statement in strict code is not\nallowed",
"description":"Declaring function within a strict \"if\" statement",
"negative":"SyntaxError",
"onlyStrict":"",
"path":"TestCases/bestPractice/Sbp_A2_T1.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls",
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbiBkZWNsYXJhdGlvbiB3aXRoaW4gYW4gImlmIiBzdGF0ZW1lbnQgaW4gc3RyaWN0IGNvZGUgaXMgbm90IGFsbG93ZWQ7CiAqCiAqIEBwYXRoIGJlc3RQcmFjdGljZS9TYnBfQTJfVDIuanMKICogQGRlc2NyaXB0aW9uIERlY2xhcmluZyBmdW5jdGlvbiB3aXRoaW4gYW4gImlmIiB0aGF0IGlzIGRlY2xhcmVkCiAqIHdpdGhpbiB0aGUgc3RyaWN0IGZ1bmN0aW9uCiAqIEBvbmx5U3RyaWN0CiAqIEBuZWdhdGl2ZSBTeW50YXhFcnJvcgogKiBAYmVzdFByYWN0aWNlIGh0dHA6Ly93aWtpLmVjbWFzY3JpcHQub3JnL2Rva3UucGhwP2lkPWNvbnZlbnRpb25zOm5vX25vbl9zdGFuZGFyZF9zdHJpY3RfZGVjbHMKICovCgoidXNlIHN0cmljdCI7CihmdW5jdGlvbigpewogICBpZiAodHJ1ZSkgewogICAgIGZ1bmN0aW9uIF9fZnVuYygpe307CiAgIH0gZWxzZSB7CiAgICAgZnVuY3Rpb24gX19mdW5jKCl7fTsKICAgfQp9KTsKCg==",
"commentary":"Function declaration within an \"if\" statement in strict code is not allowed;",
"description":"Declaring function within an \"if\" that is declared\nwithin the strict function",
"negative":"SyntaxError",
"onlyStrict":"",
"path":"TestCases/bestPractice/Sbp_A2_T2.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls",
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbkRlY2xhcmF0aW9uIHdpdGhpbiBhICJkby13aGlsZSIgQmxvY2sgaW4gc3RyaWN0IGNvZGUgaXMgbm90CiAqIGFsbG93ZWQKICoKICogQHBhdGggYmVzdFByYWN0aWNlL1NicF9BM19UMS5qcwogKiBAZGVzY3JpcHRpb24gRGVjbGFyaW5nIGZ1bmN0aW9uIHdpdGhpbiBhICJkby13aGlsZSIgbG9vcAogKiBAb25seVN0cmljdAogKiBAbmVnYXRpdmUgU3ludGF4RXJyb3IKICogQGJlc3RQcmFjdGljZSBodHRwOi8vd2lraS5lY21hc2NyaXB0Lm9yZy9kb2t1LnBocD9pZD1jb252ZW50aW9uczpub19ub25fc3RhbmRhcmRfc3RyaWN0X2RlY2xzCiAqLwoKInVzZSBzdHJpY3QiOwpkbyB7CiAgICBmdW5jdGlvbiBfX2Z1bmMoKXt9Owp9IHdoaWxlKDApOwoK",
"commentary":"FunctionDeclaration within a \"do-while\" Block in strict code is not\nallowed",
"description":"Declaring function within a \"do-while\" loop",
"negative":"SyntaxError",
"onlyStrict":"",
"path":"TestCases/bestPractice/Sbp_A3_T1.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls",
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbkRlY2xhcmF0aW9uIHdpdGhpbiBhICJkby13aGlsZSIgQmxvY2sgaW4gc3RyaWN0IGNvZGUgaXMgbm90IGFsbG93ZWQKICoKICogQHBhdGggYmVzdFByYWN0aWNlL1NicF9BM19UMi5qcwogKiBAZGVzY3JpcHRpb24gRGVjbGFyaW5nIGEgZnVuY3Rpb24gd2l0aGluIGEgImRvLXdoaWxlIiBsb29wIHRoYXQgaXMKICogd2l0aGluIGEgc3RyaWN0IGZ1bmN0aW9uCiAqIEBvbmx5U3RyaWN0CiAqIEBuZWdhdGl2ZSBTeW50YXhFcnJvcgogKiBAYmVzdFByYWN0aWNlIGh0dHA6Ly93aWtpLmVjbWFzY3JpcHQub3JnL2Rva3UucGhwP2lkPWNvbnZlbnRpb25zOm5vX25vbl9zdGFuZGFyZF9zdHJpY3RfZGVjbHMKICovCgoidXNlIHN0cmljdCI7CihmdW5jdGlvbigpewogICBkbyB7CiAgICAgZnVuY3Rpb24gX19mdW5jKCl7fTsKICAgfSB3aGlsZSgwKTsKfSk7Cgo=",
"commentary":"FunctionDeclaration within a \"do-while\" Block in strict code is not allowed",
"description":"Declaring a function within a \"do-while\" loop that is\nwithin a strict function",
"negative":"SyntaxError",
"onlyStrict":"",
"path":"TestCases/bestPractice/Sbp_A3_T2.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls",
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbkRlY2xhcmF0aW9uIHdpdGhpbiBhICJ3aGlsZSIgU3RhdGVtZW50IGlzIG5vdCBhbGxvd2VkCiAqCiAqIEBwYXRoIGJlc3RQcmFjdGljZS9TYnBfQTRfVDEuanMKICogQGRlc2NyaXB0aW9uIENoZWNraW5nIGlmIGRlY2xhcmluZyBhIGZ1bmN0aW9uIHdpdGhpbiBhICJ3aGlsZSIKICogU3RhdGVtZW50IGxlYWRzIHRvIGFuIGV4Y2VwdGlvbgogKiBAb25seVN0cmljdAogKiBAbmVnYXRpdmUgU3ludGF4RXJyb3IKICogQGJlc3RQcmFjdGljZSBodHRwOi8vd2lraS5lY21hc2NyaXB0Lm9yZy9kb2t1LnBocD9pZD1jb252ZW50aW9uczpub19ub25fc3RhbmRhcmRfc3RyaWN0X2RlY2xzCiAqLwoKInVzZSBzdHJpY3QiOwp3aGlsZSAoMCkgewogICAgZnVuY3Rpb24gX19mdW5jKCl7fTsKfTsKCg==",
"commentary":"FunctionDeclaration within a \"while\" Statement is not allowed",
"description":"Checking if declaring a function within a \"while\"\nStatement leads to an exception",
"negative":"SyntaxError",
"onlyStrict":"",
"path":"TestCases/bestPractice/Sbp_A4_T1.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls",
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbkRlY2xhcmF0aW9uIHdpdGhpbiBhICJ3aGlsZSIgU3RhdGVtZW50IGlzIG5vdCBhbGxvd2VkCiAqCiAqIEBwYXRoIGJlc3RQcmFjdGljZS9TYnBfQTRfVDIuanMKICogQGRlc2NyaXB0aW9uIENoZWNraW5nIGlmIGRlY2xhcmluZyBhIGZ1bmN0aW9uIHdpdGhpbiBhICJ3aGlsZSIKICogIFN0YXRlbWVudCB0aGF0IGlzIGluIGEgZnVuY3Rpb24gY2FsbCBsZWFkcyB0byBhbiBleGNlcHRpb24KICogQG9ubHlTdHJpY3QKICogQG5lZ2F0aXZlIFN5bnRheEVycm9yCiAqIEBiZXN0UHJhY3RpY2UgaHR0cDovL3dpa2kuZWNtYXNjcmlwdC5vcmcvZG9rdS5waHA/aWQ9Y29udmVudGlvbnM6bm9fbm9uX3N0YW5kYXJkX3N0cmljdF9kZWNscwogKi8KCiJ1c2Ugc3RyaWN0IjsKKGZ1bmN0aW9uKCl7CiAgIHdoaWxlICgwKSB7CiAgICAgZnVuY3Rpb24gX19mdW5jKCl7fTsKICAgfTsKfSkoKTsKCg==",
"commentary":"FunctionDeclaration within a \"while\" Statement is not allowed",
"description":"Checking if declaring a function within a \"while\"\n Statement that is in a function call leads to an exception",
"negative":"SyntaxError",
"onlyStrict":"",
"path":"TestCases/bestPractice/Sbp_A4_T2.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls",
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbkRlY2xhcmF0aW9uIHdpdGhpbiBhICJmb3ItaW4iIFN0YXRlbWVudCBpcyBub3QgYWxsb3dlZAogKgogKiBAcGF0aCBiZXN0UHJhY3RpY2UvU2JwX0E1X1QxLmpzCiAqIEBkZXNjcmlwdGlvbiBEZWNsYXJpbmcgZnVuY3Rpb24gd2l0aGluIGEgImZvci1pbiIgU3RhdGVtZW50CiAqIEBvbmx5U3RyaWN0CiAqIEBuZWdhdGl2ZSBTeW50YXhFcnJvcgogKiBAYmVzdFByYWN0aWNlIGh0dHA6Ly93aWtpLmVjbWFzY3JpcHQub3JnL2Rva3UucGhwP2lkPWNvbnZlbnRpb25zOm5vX25vbl9zdGFuZGFyZF9zdHJpY3RfZGVjbHMKICovCgoidXNlIHN0cmljdCI7CmZvciAoeCBpbiB0aGlzKSB7CiAgICBmdW5jdGlvbiBfX2Z1bmMoKXt9Owp9Cgo=",
"commentary":"FunctionDeclaration within a \"for-in\" Statement is not allowed",
"description":"Declaring function within a \"for-in\" Statement",
"negative":"SyntaxError",
"onlyStrict":"",
"path":"TestCases/bestPractice/Sbp_A5_T1.js"
},
{
"bestPractice":"http://wiki.ecmascript.org/doku.php?id=conventions:no_non_standard_strict_decls",
"code":"Ly8gQ29weXJpZ2h0IDIwMDkgdGhlIFNwdXRuaWsgYXV0aG9ycy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBGdW5jdGlvbkRlY2xhcmF0aW9uIHdpdGhpbiBhICJmb3ItaW4iIFN0YXRlbWVudCBpcyBub3QgYWxsb3dlZAogKgogKiBAcGF0aCBiZXN0UHJhY3RpY2UvU2JwX0E1X1QyLmpzCiAqIEBkZXNjcmlwdGlvbiBEZWNsYXJpbmcgZnVuY3Rpb24gd2l0aGluIGEgImZvci1pbiIgU3RhdGVtZW50IHRoYXQgaXMKICogd2l0aGluIGEgZnVuY3Rpb24gY2FsbAogKiBAb25seVN0cmljdAogKiBAbmVnYXRpdmUgU3ludGF4RXJyb3IKICogQGJlc3RQcmFjdGljZSBodHRwOi8vd2lraS5lY21hc2NyaXB0Lm9yZy9kb2t1LnBocD9pZD1jb252ZW50aW9uczpub19ub25fc3RhbmRhcmRfc3RyaWN0X2RlY2xzCiAqLwoKInVzZSBzdHJpY3QiOwooZnVuY3Rpb24oKXsKICAgZm9yICh4IGluIHRoaXMpIHsKICAgICBmdW5jdGlvbiBfX2Z1bmMoKXt9OwogICB9Cn0pKCk7Cgo=",
"commentary":"FunctionDeclaration within a \"for-in\" Statement is not allowed",
"description":"Declaring function within a \"for-in\" Statement that is\nwithin a function call",
"negative":"SyntaxError",
"onlyStrict":"",
"path":"TestCases/bestPractice/Sbp_A5_T2.js"
}
]
}
}