proxybug.js 901 B

123456789101112131415161718192021222324
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. var func3 = function ()
  6. {
  7. var sc4 = WScript.LoadScript('function test(){ obj2.prop4 = {needMarshal:true}; }', 'samethread');
  8. var obj1=new Proxy({}, {set:function(target, property, value) { Reflect.set(value);}})
  9. sc4.obj2 = obj1;
  10. sc4.test();
  11. obj1.prop4 = {needMarshal:false};
  12. obj1.prop5 = {needMarshal:false};
  13. };
  14. func3();
  15. var bug = new Proxy(new Array(1), {has: () => true});
  16. var a = bug.concat();
  17. if (a[0] !== undefined || a.length !== 1) {
  18. print("failed");
  19. } else {
  20. print("passed");
  21. }