8c54a373dd
ExecutableAccessorInfo turns the property into a field. Better to keep it as a callback, and correctly deal with the changed property attributes. R=ulan@chromium.org Review URL: https://codereview.chromium.org/262053011 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21558 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
14 lines
549 B
JavaScript
14 lines
549 B
JavaScript
// Copyright 2014 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
function foo(){}
|
|
Object.defineProperty(foo, "prototype", { value: 2 });
|
|
assertEquals(2, foo.prototype);
|
|
|
|
function bar(){}
|
|
Object.defineProperty(bar, "prototype", { value: 2, writable: false });
|
|
assertEquals(2, bar.prototype);
|
|
assertThrows(function() { "use strict"; bar.prototype = 10; }, TypeError);
|
|
assertEquals(false, Object.getOwnPropertyDescriptor(bar,"prototype").writable);
|