Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-36404

js bson integration should support a per object js protection flag

    XMLWordPrintable

    Details

    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

       
      load('jstests/libs/parallelTester.js');
       
      var x = NumberLong("1000");
       
      print(tojson(x));
       
      var thread = new Thread(function(s) {
        print(tojson(s));
      }, x);
      thread.start();
      thread.join();
      

      Show
        load( 'jstests/libs/parallelTester.js' );   var x = NumberLong( "1000" );   print(tojson(x));   var thread = new Thread( function (s) { print(tojson(s)); }, x); thread.start(); thread.join();

      Description

      Currently, we hard pivot between bson code values and js functions with the global isJavaScriptProtectionEnabled() function.  To workaround passing functions between threads (in ScopedThread) we manually walk objects and eval functions.

      Rather than doing that kind of dance, we should offer a per object flag to control that behavior (and set it for bson passed between js threads).

      We should also remove the scrubbing that occurs in _threadStartWrapper()

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: