diff options
author | max99x <max99x@gmail.com> | 2011-07-18 02:22:04 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-07-18 02:22:04 +0300 |
commit | 5f5069f6ef7a3e364b4af9606a49edd315a1a153 (patch) | |
tree | 771d6546cf88262c508362745660ab6b46659d0e | |
parent | 0f5a619177d9b9864378642aa55a600594259e55 (diff) | |
parent | 756e3e1ae499bc8849cc82ef3bf33f55fe767ef6 (diff) |
Merge remote-tracking branch 'upstream/master'
-rw-r--r-- | src/runtime.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime.js b/src/runtime.js index 8acb9260..559dd125 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -169,14 +169,14 @@ Runtime = { // but not at runtime. The reason is that during compilation we cannot simplify // the type names yet.) generateStructInfo: function(struct, typeName) { - var fields = struct.map(function(item) { return item[0] }); var type, alignment; if (typeName) { type = Types.types[typeName]; if (!type) return null; + assert(type.fields.length === struct.length, 'Number of named fields must match the type for ' + typeName); alignment = type.flatIndexes; } else { - var type = { fields: fields }; + var type = { fields: struct.map(function(item) { return item[0] }) }; alignment = Runtime.calculateStructAlignment(type); } var ret = { |