2017-06-23 18:06:01 +02:00
|
|
|
// Copyright (C) 2017 Rick Waldron. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
description: >
|
|
|
|
Including propertyHelper.js will expose:
|
|
|
|
|
|
|
|
verifyProperty()
|
|
|
|
...
|
|
|
|
|
2018-10-07 20:43:56 +02:00
|
|
|
includes: [propertyHelper.js]
|
2017-06-23 18:06:01 +02:00
|
|
|
---*/
|
|
|
|
|
|
|
|
var threw = false;
|
|
|
|
var object = Object.defineProperty({}, "prop", {
|
|
|
|
value: 1
|
|
|
|
});
|
|
|
|
|
|
|
|
try {
|
|
|
|
verifyProperty(object, "prop", {
|
|
|
|
value: 2
|
|
|
|
});
|
|
|
|
} catch(err) {
|
|
|
|
threw = true;
|
|
|
|
if (err.constructor !== Test262Error) {
|
|
|
|
throw new Error(
|
|
|
|
'Expected a Test262Error, but a "' + err.constructor.name +
|
|
|
|
'" was thrown.'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2018-03-22 21:36:57 +01:00
|
|
|
if (err.message !== 'descriptor value should be 2') {
|
2017-06-23 18:06:01 +02:00
|
|
|
$ERROR('The error thrown did not define the specified message.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (threw === false) {
|
|
|
|
$ERROR('Expected a Test262Error, but no error was thrown.');
|
|
|
|
}
|