mirror of https://github.com/tc39/test262.git
1 line
2.6 KiB
JSON
1 line
2.6 KiB
JSON
{"testsCollection":{"name":"Chapter - 15.4.4.12","numTests":"2","tests":[{"code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoewogICAgaWQ6ICIxNS40LjQuMTItOS1hLTEiLAoKICAgIHBhdGg6ICJUZXN0Q2FzZXMvY2hhcHRlcjE1LzE1LjQvMTUuNC40LzE1LjQuNC4xMi8xNS40LjQuMTItOS1hLTEuanMiLAoKICAgIGRlc2NyaXB0aW9uOiAiQXJyYXkucHJvdG90eXBlLnNwbGljZSAtICdmcm9tJyBpcyB0aGUgcmVzdWx0IG9mIFRvU3RyaW5nKGFjdHVhbFN0YXJ0K2spIGluIGFuIEFycmF5IiwKCiAgICB0ZXN0OiBmdW5jdGlvbiB0ZXN0Y2FzZSgpIHsKICAgICAgICB2YXIgYXJyT2JqID0gWzEsIDIsIDNdOwogICAgICAgIHZhciBuZXdBcnJPYmogPSBhcnJPYmouc3BsaWNlKC0yLCAxKTsKICAgICAgICByZXR1cm4gbmV3QXJyT2JqLmxlbmd0aCA9PT0gMSAmJiBuZXdBcnJPYmpbMF0gPT09IDI7CiAgICB9LAoKICAgIHByZWNvbmRpdGlvbjogZnVuY3Rpb24gcHJlcmVxKCkgewogICAgICAgIHJldHVybiB0cnVlOwogICAgfQp9KTsKCg==","id":"15.4.4.12-9-a-1"},{"code":"RVM1SGFybmVzcy5yZWdpc3RlclRlc3QoewogICAgaWQ6ICIxNS40LjQuMTItOS1jLWlpLTEiLAoKICAgIHBhdGg6ICJUZXN0Q2FzZXMvY2hhcHRlcjE1LzE1LjQvMTUuNC40LzE1LjQuNC4xMi8xNS40LjQuMTItOS1jLWlpLTEuanMiLAoKICAgIGRlc2NyaXB0aW9uOiAiQXJyYXkucHJvdG90eXBlLnNwbGljZSB3aWxsIHNwbGljZSBhbiBhcnJheSBldmVuIHdoZW4gQXJyYXkucHJvdG90eXBlIGhhcyBpbmRleCAnMCcgc2V0IHRvIHJlYWQtb25seSBhbmQgJ2Zyb21QcmVzZW50JyBsZXNzIHRoYW4gJ2FjdHVhbERlbGV0ZUNvdW50IChTdGVwIDkuYy5paSkiLAoKICAgIHRlc3Q6IGZ1bmN0aW9uIHRlc3RjYXNlKCkgewogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHZhciBhcnIgPSBbImEiLCAiYiIsICJjIl07CiAgICAgICAgICAgIEFycmF5LnByb3RvdHlwZVswXSA9ICJ0ZXN0IjsKICAgICAgICAgICAgdmFyIG5ld0FyciA9IGFyci5zcGxpY2UoMiwgMSwgImQiKTsKCiAgICAgICAgICAgIHZhciB2ZXJpZnlWYWx1ZSA9IGZhbHNlOwogICAgICAgICAgICB2ZXJpZnlWYWx1ZSA9IGFyci5sZW5ndGggPT09IDMgJiYgYXJyWzBdID09PSAiYSIgJiYgYXJyWzFdID09PSAiYiIgJiYgYXJyWzJdID09PSAiZCIKICAgICAgICAgICAgICAgICYmIG5ld0FyclswXSA9PT0gImMiICYmIG5ld0Fyci5sZW5ndGggPT09IDE7CgogICAgICAgICAgICB2YXIgdmVyaWZ5RW51bWVyYWJsZSA9IGZhbHNlOwogICAgICAgICAgICBmb3IgKHZhciBwIGluIG5ld0FycikgewogICAgICAgICAgICAgICAgaWYgKG5ld0Fyci5oYXNPd25Qcm9wZXJ0eSgiMCIpICYmIHAgPT09ICIwIikgewogICAgICAgICAgICAgICAgICAgIHZlcmlmeUVudW1lcmFibGUgPSB0cnVlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICB2YXIgdmVyaWZ5V3JpdGFibGUgPSBmYWxzZTsKICAgICAgICAgICAgbmV3QXJyWzBdID0gMTI7CiAgICAgICAgICAgIHZlcmlmeVdyaXRhYmxlID0gbmV3QXJyWzBdID09PSAxMjsKCiAgICAgICAgICAgIHZhciB2ZXJpZnlDb25maWd1cmFibGUgPSBmYWxzZTsKICAgICAgICAgICAgZGVsZXRlIG5ld0FyclswXTsKICAgICAgICAgICAgdmVyaWZ5Q29uZmlndXJhYmxlID0gbmV3QXJyLmhhc093blByb3BlcnR5KCIwIik7CgogICAgICAgICAgICByZXR1cm4gdmVyaWZ5VmFsdWUgJiYgIXZlcmlmeUNvbmZpZ3VyYWJsZSAmJiB2ZXJpZnlFbnVtZXJhYmxlICYmIHZlcmlmeVdyaXRhYmxlOwogICAgICAgIH0gZmluYWxseSB7CiAgICAgICAgICAgIGRlbGV0ZSBBcnJheS5wcm90b3R5cGVbMF07CiAgICAgICAgfQogICAgfSwKCiAgICBwcmVjb25kaXRpb246IGZ1bmN0aW9uIHByZXJlcSgpIHsKICAgICAgICByZXR1cm4gZm5FeGlzdHMoT2JqZWN0LmRlZmluZVByb3BlcnR5KTsKICAgIH0KfSk7Cg==","id":"15.4.4.12-9-c-ii-1"}]}} |