~ubuntu-branches/ubuntu/vivid/mozjs24/vivid

« back to all changes in this revision

Viewing changes to js/src/jit-test/tests/proxy/testDirectProxyHasOwn4.js

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2014-02-11 21:55:34 UTC
  • Revision ID: package-import@ubuntu.com-20140211215534-m1zyq5aj59md3y07
Tags: upstream-24.2.0
ImportĀ upstreamĀ versionĀ 24.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
load(libdir + "asserts.js");
 
2
 
 
3
/*
 
4
 * Throw a TypeError if the trap reports an existing own property as
 
5
 * non-existent on a non-extensible object
 
6
 */
 
7
var target = {};
 
8
Object.defineProperty(target, 'foo', {
 
9
    configurable: true
 
10
});
 
11
Object.preventExtensions(target);
 
12
var caught = false;
 
13
assertThrowsInstanceOf(function () {
 
14
    ({}).hasOwnProperty.call(new Proxy(target, {
 
15
        hasOwn: function (target, name) {
 
16
            return false;
 
17
        }
 
18
    }), 'foo');
 
19
}, TypeError);