This is a testharness.js-based test. [FAIL] WebSocket constructor with matching targetAddressSpace 'loopback' succeeds Failed to construct 'WebSocket': The subprotocol '[object Object]' is invalid. [FAIL] WebSocket constructor with targetAddressSpace 'private' throws TypeError as it is an unsupported legacy alias assert_throws_js: function "() => {\n new WebSocket(SCHEME_DOMAIN_PORT + '/echo',\n {targetAddressSpace: 'private'});\n }" threw object "SyntaxError: Failed to construct 'WebSocket': The subprotocol '[object Object]' is invalid." ("SyntaxError") expected instance of function "function TypeError() { [native code] }" ("TypeError") [FAIL] WebSocket constructor with mismatched targetAddressSpace 'local' fails connection Failed to construct 'WebSocket': The subprotocol '[object Object]' is invalid. [FAIL] WebSocket constructor with mismatched targetAddressSpace 'public' fails connection Failed to construct 'WebSocket': The subprotocol '[object Object]' is invalid. [FAIL] WebSocket constructor with targetAddressSpace 'unknown' throws TypeError assert_throws_js: function "() => {\n new WebSocket(SCHEME_DOMAIN_PORT + '/echo',\n {targetAddressSpace: 'unknown'});\n }" threw object "SyntaxError: Failed to construct 'WebSocket': The subprotocol '[object Object]' is invalid." ("SyntaxError") expected instance of function "function TypeError() { [native code] }" ("TypeError") [FAIL] WebSocket constructor with invalid targetAddressSpace throws TypeError assert_throws_js: function "() => {\n new WebSocket(SCHEME_DOMAIN_PORT + '/echo',\n {targetAddressSpace: 'invalid'});\n }" threw object "SyntaxError: Failed to construct 'WebSocket': The subprotocol '[object Object]' is invalid." ("SyntaxError") expected instance of function "function TypeError() { [native code] }" ("TypeError") Harness: the test ran to completion.