anchor.diff:  // TODO(eub, sigmund): move the "manager" to be entirely in JS.
   // Running any Dart code outside the context of an isolate gives it
   // the change to break the isolate abstraction.
  -_Manager get _globalState() native "return \$globalState;";
  -set _globalState(_Manager val) native "\$globalState = val;";
  -
  -void _fillStatics(context) native r"""
  -  $globals = context.isolateStatics;
  -  $static_init();
  -""";
  +_Manager get _globalState() => JS("Object", r"$globalState");
  +set _globalState(_Manager val) {
  +  JS("void", r"$globalState = #", val);
  +}
  +
  +void _fillStatics(context) {
  +  JS("void", r"$globals = #.isolateStatics", context);
  +  JS("void", r"$static_init()");
  +}
   
   ReceivePort _lazyPort;
   patch ReceivePort get port() {
  
positive.code:     }
    }
  
    static void _consoleLog(msg) native "\$globalThis.console.log(msg);";
  
    /**
     * Extract the constructor of runnable, so it can be allocated in another
     * isolate.
     */
    static Dynamic _getJSConstructor(Isolate runnable) native """
      return runnable.constructor;
    """;
  
    /** Extract the constructor name of a runnable */
    // TODO(sigmund): find a browser-generic way to support this.
    static Dynamic _getJSConstructorName(Isolate runnable) native """
      return runnable.constructor.name;
    """;
  
    /** Find a constructor given its name. */
    static Dynamic _getJSConstructorFromName(String factoryName) native """
      return \$globalThis[factoryName];
    """;
  
    static Dynamic _getJSFunctionFromName(String functionName) native """
      return \$globalThis[functionName];
    """;
  
    /**
     * Get a string name for the function, if possible.  The result for
     * anonymous functions is browser-dependent -- it may be "" or "anonymous"
     * but you should probably not count on this.
     */
    static String _getJSFunctionName(Function f)
      native r"return f.$name || (void 0);";
  
    /** Create a new JavaScript object instance given its constructor. */
    static Dynamic _allocate(var ctor) native "return new ctor();";
  
    // TODO(sigmund): clean up above, after we make the new API the default:
  
  
negative.code:   void set onmessage(f) {
      throw new Exception("onmessage should not be set on MainManagerStub");
    }
    void postMessage(msg) { JS("void", r"$globalThis.postMessage(#)", msg); }
    void terminate() {}  // Nothing useful to do here.
  }
  
  