test262/website/json/bestPractice.json

1 line
14 KiB
JSON
Raw Normal View History

2012-02-04 00:23:28 +01:00
{"testsCollection":{"name":"Chapter - bestPractice","numTests":"13","tests":[{"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":"Ly8gQ29weXJpZ2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AgaWYgKGVycjMgaW5zdGFuY2VvZiBUeXBlRXJyb3IpIHsgcmV0dXJuOyB9CiAgICAgJEVSUk9SKCcjMTogQnVpbHQtaW4gImNhbGxlciIgZmFpbGVkIHdpdGg6ICcgKyBlcnIzKTsKICAgfQogICBpZiAobnVsbCA9PT0gY2FsbGVyIHx8IHZvaWQgMCA9PT0gY2FsbGVyKSB7IHJldHVybjsgfQogICBpZiAodGVzdGZuID09PSBjYWxsZXIpIHsKICAgICAkRVJST1IoJyMyOiBCdWlsdC1pbiByZXZlYWxlZCBjYWxsZXInKTsKICAgfQogICAkRVJST1IoJyMzOiBVbmV4cGVjdGVkICJjYWxsZXIiOiAnICsgY2FsbGVyKTsKfSkoKTs=","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":"Ly8gQ29weXJpZ2h0IDIwMTEgR29vZ2xlIEluYy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuCi8qKgogKiBAcGF0aCBiZXN0UHJhY3RpY2UvU2JwX0ExMF9UMi5qcwogKiBAZGVzY3JpcHRpb24gQnVpbHQtaW4gZnVuY3Rpb25zIHNob3VsZCBub3QgaGF2ZSBhIG5vbi1kZWxldGFibGUsCiAqIG5vbi1wb2lzb25lZCAiYXJndW1lbnRzIiBwcm9wZXJ0eS4KICogQGJlc3RQcmFjdGljZQogKiBodHRwOi8vd2lraS5lY21hc2NyaXB0Lm9yZy9kb2t1LnBocD9pZD1jb252ZW50aW9uczptYWtlX25vbi1zdGFuZGFyZF9wcm9wZXJ0aWVzX2NvbmZpZ3VyYWJsZQogKi8KCihmdW5jdGlvbigpIHsKICAgdmFyIG1hcCA9IEFycmF5LnByb3RvdHlwZS5tYXA7CiAgIGlmICghbWFwKSB7IHJldHVybjsgfQogICB0cnkgewogICAgIGRlbGV0ZSBtYXAuYXJndW1lbnRzOwogICB9IGNhdGNoIChlcnIxKSB7CiAgICAgLy8gaWdub3JlCiAgIH0KICAgaWYgKCdhcmd1bWVudHMnIGluIG1hcCkgewogICAgIHRyeSB7CiAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkobWFwLCAnYXJndW1lbnRzJywgewogICAgICAgICB3cml0YWJsZTogZmFsc2UsCiAgICAgICAgIGNvbmZpZ3VyYWJsZTogZmFsc2UKICAgICAgIH0pOwogICAgIH0gY2F0Y2ggKGVycjIpIHsKICAgICAgIC8vIGlnbm9yZQogICAgIH0KICAgfQoKICAgZnVuY3Rpb24gZm9vKG0pIHsgcmV0dXJuIG0uYXJndW1lbnRzOyB9CiAgIGZ1bmN0aW9uIHRlc3RmbihhLCBmKSB7IHJldHVy