diff options
author | max99x <max99x@gmail.com> | 2011-08-17 07:44:59 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-08-17 07:44:59 +0300 |
commit | 25630c272ddd8d260f4bd8d60db5f2b01b6a00e8 (patch) | |
tree | 8708398c75748234299abae35dbdb3f8a095a5c6 /src/runtime.js | |
parent | ee4b6ebf353585fb0eb0809a4b677f5694a9ba79 (diff) | |
parent | c2d71f807a84cb1cfad154c59e9d6859fff3e631 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/runtime.js')
-rw-r--r-- | src/runtime.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime.js b/src/runtime.js index ad3c973d..abeb0d2a 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -183,11 +183,11 @@ Runtime = { var type, alignment; if (typeName) { offset = offset || 0; - type = typeof Types === 'undefined' ? Runtime.typeInfo[typeName] : Types.types[typeName]; + type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName]; if (!type) return null; - if (!struct) struct = Types.structMetadata[typeName.replace(/.*\./, '')]; + if (!struct) struct = (typeof Types === 'undefined' ? Runtime : Types).structMetadata[typeName.replace(/.*\./, '')]; if (!struct) return null; - assert(type.fields.length === struct.length, 'Number of named fields must match the type for ' + typeName); + assert(type.fields.length === struct.length, 'Number of named fields must match the type for ' + typeName + '. Perhaps due to inheritance, which is not supported yet?'); alignment = type.flatIndexes; } else { var type = { fields: struct.map(function(item) { return item[0] }) }; |