-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.html
201 lines (170 loc) · 3.83 KB
/
README.html
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>README</title>
<style>
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* Generic styles */
body {
background: #f5f5f5;
color: #222;
font-family: 'Palatino Linotype','Book Antiqua',Palatino,FreeSerif,serif;
font-size: 16px;
margin: 0;
padding: 0;
}
h1, h2, h3, h4, h5, h6,
ul, ol,
p,
code, pre,
hr {
line-height: 1.5em;
margin: 1.5em 0 0.5em 0;
}
*:first-child {
margin-top: 0;
}
/* Headers */
h1, h2, h3, h4, h5, h6 {
font-weight: bold;
}
h1 {
font-size: 3.5em;
}
h2 {
font-size: 2.5em;
}
h3 {
font-size: 2em;
}
h4 {
font-size: 1.5em
}
h5 {
font-size: 1.2em;
}
h6 {
font-size: 1em;
}
/* Lists */
ul, ol {
padding-left: 2em;
}
ul {
list-style-type: disc;
}
ol {
list-style-type: decimal;
}
/* Code and pre */
code, pre {
font-family: "Bitstream Vera Sans Mono", "Courier", monospace;
}
code {
background: none repeat scroll 0 0 #F8F8FF;
border: 1px solid #DEDEDE;
border-radius: 3px ;
padding: 0 0.2em;
}
pre {
border-left: 5px solid #eee;
margin-left: 2em;
padding-left: 1em;
}
pre > code {
background: transparent;
border: none;
padding: 0;
}
/* Links */
a {
color: #261A3B;
}
a:visited {
color: #261A3B;
}
/* Inlines */
strong {
font-weight: bold;
}
em {
font-style: italic;
}
/* Container */
.container {
background: #FFF;
padding: 30px 50px;
margin: 0 auto;
width: 850px;
}
</style>
</head>
<body>
<div class="container">
<h1>protoExplorer</h1>
<ul>
<li>a forum for exploring JS classing techniques and their effects on <code>__proto__</code></li>
</ul>
<p>Implement extra-fancy Hello World components using only jQuery as a support library. Three levels of functionality motivate a base class, its extension, and an extension of the extension. The three levels are implemented three times each, using different JS classing techniques for the sake of comparing effects of those techniques on <code>__proto__</code>, on property pass-through, and on property override (only two implemented so far).</p>
<p>Contents:</p>
<ul>
<li><code>oldFashioned</code> subclassing using <code>new</code> to create a constructor's prototype</li>
<li><code>objectCreate</code> subclassing using <code>Object.create</code> to create a constructor's prototype</li>
<li><code>private</code> subclassing by creating two constructors and their prototypes (niy)</li>
</ul>
<h2>Old Fashioned</h2>
<p>Using <code>new</code> to create a constructor's prototype used to be the only way, but since <code>Object.create</code> came along, tends to be frowned up.</p>
<p>We create a reference implementation using this technique for the sake of comparison.</p>
<h2>Object.create</h2>
<p>Identical to Old Fashioned except in the way the prototypes of the subclasses are assigned.</p>
</div>
<script></script>
</body>
</html>