tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

assign-primitive-proxy-class-error.js (393B)


      1 'use strict';
      2 
      3 load(libdir + 'asserts.js');
      4 
      5 let hook = {}
      6 let Base = function() {}
      7 Base.prototype = new Proxy(Base.prototype, hook);
      8 class Derived extends Base {
      9    testPrimitiveReceiver() {
     10        super.foo = "Derived";
     11    }
     12 }
     13 assertTypeErrorMessage(() => Derived.prototype.testPrimitiveReceiver.call(null),
     14                       `can't assign to property "foo" on ({}): not an object`)