1 // Copyright 2016 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Flags: --allow-natives-syntax 6 7 (function() { 8 'use strict'; 9 class A extends Function { 10 constructor(...args) { 11 super(...args); 12 this.a = 42; 13 } 14 } 15 var v1 = new A("'use strict';"); 16 function f(func) { 17 func.__defineSetter__('a', function() { }); 18 } 19 var v2 = new A(); 20 f(v2); 21 f(v1); 22 })(); 23