LEFT | RIGHT |
(no file at all) | |
1 // Copyright (C) 2011 Google Inc. | 1 // Copyright (C) 2011 Google Inc. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 Array.prototype.map.call(u8s, function(u8) { | 312 Array.prototype.map.call(u8s, function(u8) { |
313 return (u8 % 36).toString(36); | 313 return (u8 % 36).toString(36); |
314 }).join('') + '___'; | 314 }).join('') + '___'; |
315 } | 315 } |
316 | 316 |
317 function isNotHiddenName(name) { | 317 function isNotHiddenName(name) { |
318 return !( | 318 return !( |
319 name.substr(0, HIDDEN_NAME_PREFIX.length) == HIDDEN_NAME_PREFIX && | 319 name.substr(0, HIDDEN_NAME_PREFIX.length) == HIDDEN_NAME_PREFIX && |
320 name.substr(name.length - 3) === '___'); | 320 name.substr(name.length - 3) === '___'); |
321 } | 321 } |
| 322 |
| 323 // For all calls to Object.defineProperty (defProp) to redefine an |
| 324 // existing property, keep in mind that omitting some attributes, |
| 325 // like writable:, enumerable:, or configurable:, means that the |
| 326 // current setting of these attributes should be preseved, rather |
| 327 // than defaulting to false. |
| 328 |
| 329 // Note that the use of .filter as an array instance method below |
| 330 // only works in SES under the immutable primordials |
| 331 // assumption. For example, it would not work in CES (Confined |
| 332 // EcmaScript). |
322 | 333 |
323 /** | 334 /** |
324 * Monkey patch getOwnPropertyNames to avoid revealing the | 335 * Monkey patch getOwnPropertyNames to avoid revealing the |
325 * HIDDEN_NAME. | 336 * HIDDEN_NAME. |
326 * | 337 * |
327 * <p>The ES5.1 spec requires each name to appear only once, but as | 338 * <p>The ES5.1 spec requires each name to appear only once, but as |
328 * of this writing, this requirement is controversial for ES6, so we | 339 * of this writing, this requirement is controversial for ES6, so we |
329 * made this code robust against this case. If the resulting extra | 340 * made this code robust against this case. If the resulting extra |
330 * search turns out to be expensive, we can probably relax this once | 341 * search turns out to be expensive, we can probably relax this once |
331 * ES6 is adequately supported on all major browsers, iff no browser | 342 * ES6 is adequately supported on all major browsers, iff no browser |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 value: DoubleWeakMap, | 760 value: DoubleWeakMap, |
750 enumerable: false, // as default .constructor is | 761 enumerable: false, // as default .constructor is |
751 configurable: true, | 762 configurable: true, |
752 writable: true | 763 writable: true |
753 }); | 764 }); |
754 | 765 |
755 return DoubleWeakMap; | 766 return DoubleWeakMap; |
756 } | 767 } |
757 | 768 |
758 })(); | 769 })(); |
LEFT | RIGHT |