| LEFT | RIGHT |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <http://adblockplus.org/>, | 2 * This file is part of Adblock Plus <http://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2014 Eyeo GmbH | 3 * Copyright (C) 2006-2014 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 * }); | 37 * }); |
| 38 * | 38 * |
| 39 * The first parameter to ObjectType defines object properties and methods. A | 39 * The first parameter to ObjectType defines object properties and methods. A |
| 40 * name can either be associted with a type (property) or function (method). | 40 * name can either be associted with a type (property) or function (method). |
| 41 * Numeric value types from the ECMAScript Harmony proposal are predefined as | 41 * Numeric value types from the ECMAScript Harmony proposal are predefined as |
| 42 * well as "boolean" which is an alias for uint8. In addition to that, already | 42 * well as "boolean" which is an alias for uint8. In addition to that, already |
| 43 * defined object types can be used. | 43 * defined object types can be used. |
| 44 * | 44 * |
| 45 * The optional second parameter sets type metadata: | 45 * The optional second parameter sets type metadata: |
| 46 * | 46 * |
| 47 * constructor: function that will be called whenever an object of the type i
s | 47 * constructor: function that will be called whenever an object of the type |
| 48 * created. | 48 * is created. |
| 49 * bufferSize: number of objects that should be placed into a single typed | 49 * bufferSize: number of objects that should be placed into a single typed |
| 50 * buffer (by default 128). | 50 * buffer (by default 128). |
| 51 * | 51 * |
| 52 * Creating an object instance | 52 * Creating an object instance |
| 53 * --------------------------- | 53 * --------------------------- |
| 54 * | 54 * |
| 55 * var point = Point2D(5, 10); | 55 * var point = Point2D(5, 10); |
| 56 * point.rotate(10); | 56 * point.rotate(10); |
| 57 * Console.log(point.x + ", " + point.y); | 57 * Console.log(point.x + ", " + point.y); |
| 58 * | 58 * |
| 59 * The parameters 5 and 10 will be passed to the constructor function defined | 59 * The parameters 5 and 10 will be passed to the constructor function defined |
| 60 * for this type. | 60 * for this type. |
| 61 */ | 61 */ |
| 62 | 62 |
| 63 function forwardExports(module) | 63 function forwardExports(module) |
| 64 { | 64 { |
| 65 let moduleExports = require(module); | 65 let moduleExports = require(module); |
| 66 for (let key in moduleExports) | 66 for (let key in moduleExports) |
| 67 exports[key] = moduleExports[key]; | 67 exports[key] = moduleExports[key]; |
| 68 } | 68 } |
| 69 | 69 |
| 70 forwardExports("typedObjects/primitiveTypes"); | 70 forwardExports("typedObjects/primitiveTypes"); |
| 71 forwardExports("typedObjects/objectTypes"); | 71 forwardExports("typedObjects/objectTypes"); |
| LEFT | RIGHT |