-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c3be9e
commit 5b814d6
Showing
2 changed files
with
50 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
/* eeslint-disable no-console */ | ||
|
||
'use strict'; | ||
|
||
const {last} = require('lodash'); | ||
const input = function() {}; | ||
input.prototype = [11, 22]; | ||
Object.defineProperty(input.prototype, 'constructor', {value: input, writable: true, configurable: true}); | ||
input.prototype[Symbol.toStringTag] = 'Array'; | ||
|
||
let a = 1; | ||
function outer() { | ||
let b = a; | ||
/* | ||
class A extends Array {} | ||
A.prototype[Symbol.toStringTag] = 'Object'; | ||
function inner() { | ||
return `a = ${a}, b = ${b}`; | ||
} | ||
function setA(newA) { | ||
a = newA; | ||
} | ||
function setB(newB) { | ||
b = newB; | ||
} | ||
class A2 extends A {} | ||
return {inner, setA, setB}; | ||
} | ||
const input = A2; | ||
*/ | ||
|
||
const {inner: inner1, setA, setB: setB1} = outer(); | ||
setA(100); | ||
const {inner: inner2, setB: setB2} = outer(); | ||
setB1(200); | ||
setB2(300); | ||
/* | ||
function input() {} | ||
input.prototype = Array.prototype; | ||
*/ | ||
|
||
module.exports = {inner1, inner2, last}; | ||
module.exports = input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters