ScopedThreads do not receive non-enumerable properties of objects

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: JavaScript
    • None
    • ALL
    • Hide
      load('jstests/libs/parallelTester.js')
      
      var func = function (args) {
          assert(args.a, 'no property a');
          assert.eq(args.a, 1, 'property a has wrong value');
          assert(args.b, 'no property b');
          assert.eq(args.b, 2, 'property b has wrong value');
          assert(args.c, 'no property c');
          assert.eq(args.c, 3, 'property c has wrong value');
      }
      var args = {a: 1};
      Object.defineProperty(args, 'b', {
          value: 2,
          enumerable: true
      });
      Object.defineProperty(args, 'c', {
          value: 3
      });
      a = new ScopedThread( func, args );
      a.start();
      a.join();
      
      Show
      load( 'jstests/libs/parallelTester.js' ) var func = function (args) { assert (args.a, 'no property a' ); assert .eq(args.a, 1, 'property a has wrong value' ); assert (args.b, 'no property b' ); assert .eq(args.b, 2, 'property b has wrong value' ); assert (args.c, 'no property c' ); assert .eq(args.c, 3, 'property c has wrong value' ); } var args = {a: 1}; Object .defineProperty(args, 'b' , { value: 2, enumerable: true }); Object .defineProperty(args, 'c' , { value: 3 }); a = new ScopedThread( func, args ); a.start(); a.join();
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Non-enumerable properties to a Scoped Thread via an arguments object do not get passed properly and do not appear in the object inside of the ScopedThread function. The following snippet of code illustrates the problem. Ideally none of the asserts would fail, but here only the asserts for property 'c' fail, showing that while 'args.a' and 'args.b' both get passed, 'args.c' does not.

            Assignee:
            DO NOT USE - Backlog - Platform Team
            Reporter:
            Judah Schvimer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: