xref: /third_party/node/test/parallel/test-whatwg-url-canparse.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci// Flags: --expose-internals
21cb0ef41Sopenharmony_ci'use strict';
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_cirequire('../common');
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciconst { URL } = require('url');
71cb0ef41Sopenharmony_ciconst assert = require('assert');
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_cilet internalBinding;
101cb0ef41Sopenharmony_citry {
111cb0ef41Sopenharmony_ci  internalBinding = require('internal/test/binding').internalBinding;
121cb0ef41Sopenharmony_ci} catch (e) {
131cb0ef41Sopenharmony_ci  console.log('using `test/parallel/test-whatwg-url-canparse` requires `--expose-internals`');
141cb0ef41Sopenharmony_ci  throw e;
151cb0ef41Sopenharmony_ci}
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ciconst { canParse } = internalBinding('url');
181cb0ef41Sopenharmony_ci
191cb0ef41Sopenharmony_ci// It should not throw when called without a base string
201cb0ef41Sopenharmony_ciassert.strictEqual(URL.canParse('https://example.org'), true);
211cb0ef41Sopenharmony_ciassert.strictEqual(canParse('https://example.org'), true);
22

Indexes created Thu Nov 07 10:32:03 CST 2024