| OLD | NEW |
| 1 // Copyright 2006 Google Inc. | 1 // Copyright 2006 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 236 |
| 237 /** | 237 /** |
| 238 * Clones the current context for a new context object. The cloned | 238 * Clones the current context for a new context object. The cloned |
| 239 * context has the data object as its context object and the current | 239 * context has the data object as its context object and the current |
| 240 * context as its parent context. It also sets the $index variable to | 240 * context as its parent context. It also sets the $index variable to |
| 241 * the given value. This value usually is the position of the data | 241 * the given value. This value usually is the position of the data |
| 242 * object in a list for which a template is instantiated multiply. | 242 * object in a list for which a template is instantiated multiply. |
| 243 * | 243 * |
| 244 * @param {Object} data The new context object. | 244 * @param {Object} data The new context object. |
| 245 * | 245 * |
| 246 * @param {number|string} index Position of the new context when multiply | 246 * @param {number} index Position of the new context when multiply |
| 247 * instantiated. (See implementation of jstSelect().) | 247 * instantiated. (See implementation of jstSelect().) |
| 248 * | 248 * |
| 249 * @param {number} count The total number of contexts that were multiply | 249 * @param {number} count The total number of contexts that were multiply |
| 250 * instantiated. (See implementation of jstSelect().) | 250 * instantiated. (See implementation of jstSelect().) |
| 251 * | 251 * |
| 252 * @return {JsEvalContext} | 252 * @return {JsEvalContext} |
| 253 */ | 253 */ |
| 254 JsEvalContext.prototype.clone = function(data, index, count) { | 254 JsEvalContext.prototype.clone = function(data, index, count) { |
| 255 var ret = JsEvalContext.create(data, this); | 255 var ret = JsEvalContext.create(data, this); |
| 256 ret.setVariable(VAR_index, index); | 256 ret.setVariable(VAR_index, index); |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 var ret = []; | 400 var ret = []; |
| 401 var values = expr.split(REGEXP_semicolon); | 401 var values = expr.split(REGEXP_semicolon); |
| 402 for (var i = 0, I = jsLength(values); i < I; ++i) { | 402 for (var i = 0, I = jsLength(values); i < I; ++i) { |
| 403 if (values[i]) { | 403 if (values[i]) { |
| 404 var value = jsEvalToFunction(values[i]); | 404 var value = jsEvalToFunction(values[i]); |
| 405 ret.push(value); | 405 ret.push(value); |
| 406 } | 406 } |
| 407 } | 407 } |
| 408 return ret; | 408 return ret; |
| 409 } | 409 } |
| OLD | NEW |