/js/src/jit-test/tests/jaeger/propertyOptimize-4.js
http://github.com/zpao/v8monkey · JavaScript · 17 lines · 12 code · 3 blank · 2 comment · 0 complexity · 1a8739028e467c82b934b18fc4cb306a MD5 · raw file
- // Make sure new script properties can be invalidated on specialized prototype
- // types while they are still being constructed.
- function Foo(a, b, c) {
- this.x = a + b;
- this.y = c;
- }
- updated = false;
- var o = {valueOf: function() {
- Object.defineProperty(Object.prototype, 'y', {set:function() { updated = true; }})
- }};
- function Bar() {}
- Bar.prototype = new Foo(o, 1, 2);
- assertEq(updated, true);
- assertEq(Bar.prototype.y, undefined);