Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: lib/typedObjects.js

Issue 5665229014827008: Issue 150 - [Typed objects] Implement string type (Closed)
Left Patch Set: Created May 16, 2014, 1:47 p.m.
Right Patch Set: Created May 19, 2014, 3:15 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | lib/typedObjects/arrayTypes.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 * 158 *
159 * String type 159 * String type
160 * ----------- 160 * -----------
161 * 161 *
162 * There is a special array type called string: 162 * There is a special array type called string:
163 * 163 *
164 * var str1 = string(); // empty string 164 * var str1 = string(); // empty string
165 * var str2 = string(2); // "\0\0" 165 * var str2 = string(2); // "\0\0"
166 * var str3 = string("foo"); // "foo" 166 * var str3 = string("foo"); // "foo"
167 * var str4 = string(str3, 1, 2); // "oo" 167 * var str4 = string(str3, 1, 2); // "oo"
168 * str4.get(0); // 111 - ASCII code of "o" 168 * str4.get(0); // 111 - character code of "o"
René Jeschke 2014/05/19 08:15:28 Note: 'ASCII' is not the right term here, the valu
169 * 169 *
170 * Without any constructor parameters the string will be empty, a number as 170 * Without any constructor parameters the string will be empty, a number as
171 * parameter will set the initial string length accordingly. A JavaScript string 171 * parameter will set the initial string length accordingly. A JavaScript string
172 * or another string instance as first parameter indicate that the string data 172 * or another string instance as first parameter indicate that the string data
173 * should be copied from these. Optionally, a second (offset) and third 173 * should be copied from these. Optionally, a second (offset) and third
174 * parameter (length) can be given. 174 * parameter (length) can be given.
175 * 175 *
176 * To convert a string instance into a JavaScript string you can call the 176 * To convert a string instance into a JavaScript string you can call the
177 * toString() method. 177 * toString() method.
178 */ 178 */
179 179
180 function forwardExports(module) 180 function forwardExports(module)
181 { 181 {
182 let moduleExports = require(module); 182 let moduleExports = require(module);
183 for (let key in moduleExports) 183 for (let key in moduleExports)
184 exports[key] = moduleExports[key]; 184 exports[key] = moduleExports[key];
185 } 185 }
186 186
187 forwardExports("typedObjects/primitiveTypes"); 187 forwardExports("typedObjects/primitiveTypes");
188 forwardExports("typedObjects/objectTypes"); 188 forwardExports("typedObjects/objectTypes");
189 forwardExports("typedObjects/stringType"); 189 forwardExports("typedObjects/stringType");
LEFTRIGHT

Powered by Google App Engine
This is Rietveld