| Index: test/mjsunit/object-seal.js
|
| diff --git a/test/mjsunit/object-seal.js b/test/mjsunit/object-seal.js
|
| index ef1b16d9061d0d9bb75539812d577aa29e4622c7..3c46ab236cda0154e0ba71311bcc04123eab2735 100644
|
| --- a/test/mjsunit/object-seal.js
|
| +++ b/test/mjsunit/object-seal.js
|
| @@ -25,20 +25,33 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -// Tests the Object.seal and Object.isSealed methods - ES 19.1.2.17 and
|
| -// ES 19.1.2.13
|
| +// Tests the Object.seal and Object.isSealed methods - ES 15.2.3.9 and
|
| +// ES 15.2.3.12
|
|
|
| // Flags: --allow-natives-syntax --noalways-opt
|
|
|
| -// Test that we return obj if non-object is passed as argument
|
| -var non_objects = new Array(undefined, null, 1, -1, 0, 42.43, Symbol("test"));
|
| +// Test that we throw an error if an object is not passed as argument.
|
| +var non_objects = new Array(undefined, null, 1, -1, 0, 42.43);
|
| for (var key in non_objects) {
|
| - assertSame(non_objects[key], Object.seal(non_objects[key]));
|
| -}
|
| -
|
| -// Test that isFrozen always returns true for non-objects
|
| + var exception = false;
|
| + try {
|
| + Object.seal(non_objects[key]);
|
| + } catch(e) {
|
| + exception = true;
|
| + assertTrue(/Object.seal called on non-object/.test(e));
|
| + }
|
| + assertTrue(exception);
|
| +}
|
| +
|
| for (var key in non_objects) {
|
| - assertTrue(Object.isSealed(non_objects[key]));
|
| + exception = false;
|
| + try {
|
| + Object.isSealed(non_objects[key]);
|
| + } catch(e) {
|
| + exception = true;
|
| + assertTrue(/Object.isSealed called on non-object/.test(e));
|
| + }
|
| + assertTrue(exception);
|
| }
|
|
|
| // Test normal data properties.
|
| @@ -383,9 +396,3 @@
|
| Object.seal(obj);
|
| assertTrue(%HasFastProperties(obj));
|
| assertTrue(Object.isSealed(obj));
|
| -
|
| -function Sealed() {}
|
| -Object.seal(Sealed);
|
| -assertDoesNotThrow(function() { return new Sealed(); });
|
| -Sealed.prototype.prototypeExists = true;
|
| -assertTrue((new Sealed()).prototypeExists);
|
|
|