Blame view

node_modules/setprototypeof/README.md 500 Bytes
ce4c83ff   wxy   初始提交
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  # Polyfill for `Object.setPrototypeOf`
  
  A simple cross platform implementation to set the prototype of an instianted object.  Supports all modern browsers and at least back to IE8.
  
  ## Usage:
  
  ```
  $ npm install --save setprototypeof
  ```
  
  ```javascript
  var setPrototypeOf = require('setprototypeof');
  
  var obj = {};
  setPrototypeOf(obj, {
  	foo: function() {
  		return 'bar';
  	}
  });
  obj.foo(); // bar
  ```
  
  TypeScript is also supported:
  ```typescript
  import setPrototypeOf = require('setprototypeof');
  ```