diff options
author | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-02-11 19:19:13 -0500 |
---|---|---|
committer | Ehsan Akhgari <ehsan.akhgari@gmail.com> | 2012-03-28 10:58:38 -0700 |
commit | 88e15c2423ec2f9723b28006d705ed7d31a33fe6 (patch) | |
tree | d73bae4154759066c4a705b044bc7bfcc5f718f4 /src/preamble.js | |
parent | 69638af60262c11b88802d6b8c1e53433d1baf45 (diff) |
Implement the remaining shader and program functions
Diffstat (limited to 'src/preamble.js')
-rw-r--r-- | src/preamble.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/preamble.js b/src/preamble.js index d56891d0..86a5ce80 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -765,11 +765,14 @@ Module['String_copy'] = String_copy; // This processes a JS string into a C-line array of numbers, 0-terminated. // For LLVM-originating strings, see parser.js:parseLLVMString function -function intArrayFromString(stringy, dontAddNull) { +function intArrayFromString(stringy, dontAddNull, length /* optional */) { var ret = []; var t; var i = 0; - while (i < stringy.length) { + if (length === undefined) { + length = stringy.length; + } + while (i < length) { var chr = stringy.charCodeAt(i); if (chr > 0xFF) { #if ASSERTIONS |