mirror of
https://github.com/nodejs/node.git
synced 2025-12-28 07:50:41 +00:00
PR-URL: https://github.com/nodejs/node/pull/60728 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
29 lines
612 B
JavaScript
29 lines
612 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const assert = require('assert');
|
|
const { URLPattern } = require('url');
|
|
|
|
// Verify that if an error is thrown while accessing any of the
|
|
// init options, the error is appropriately propagated.
|
|
assert.throws(() => {
|
|
new URLPattern({
|
|
get protocol() {
|
|
throw new Error('boom');
|
|
}
|
|
});
|
|
}, {
|
|
message: 'boom',
|
|
});
|
|
|
|
// Verify that if an error is thrown while accessing the ignoreCase
|
|
// option, the error is appropriately propagated.
|
|
assert.throws(() => {
|
|
new URLPattern({}, { get ignoreCase() {
|
|
throw new Error('boom');
|
|
} });
|
|
}, {
|
|
message: 'boom'
|
|
});
|