| 3875 | } |
| 3876 | |
| 3877 | void fxObjectNodeCode(void* it, void* param) |
| 3878 | { |
| 3879 | txObjectNode* self = it; |
| 3880 | txCoder* coder = param; |
| 3881 | txInteger object = fxCoderUseTemporaryVariable(param); |
| 3882 | txNode* item; |
| 3883 | txFlag flag = 0; |
| 3884 | if (self->items) { |
| 3885 | item = self->items->first; |
| 3886 | while (item) { |
| 3887 | if (item->description->token == XS_TOKEN_PROPERTY) { |
| 3888 | if (!(item->flags & mxShorthandFlag) && (((txPropertyNode*)item)->symbol == coder->parser->__proto__Symbol)) { |
| 3889 | if (flag) |
| 3890 | fxReportParserError(coder->parser, item->line, "invalid __proto__"); |
| 3891 | flag = 1; |
| 3892 | fxNodeDispatchCode(((txPropertyNode*)item)->value, param); |
| 3893 | fxCoderAddByte(param, 0, XS_CODE_INSTANTIATE); |
| 3894 | } |
| 3895 | } |
| 3896 | item = item->next; |
| 3897 | } |
| 3898 | } |
| 3899 | if (!flag) |
| 3900 | fxCoderAddByte(param, 1, XS_CODE_OBJECT); |
| 3901 | fxCoderAddIndex(param, 0, XS_CODE_SET_LOCAL_1, object); |
| 3902 | if (self->items) { |
| 3903 | item = self->items->first; |
| 3904 | while (item) { |
| 3905 | if (item->description->token == XS_TOKEN_SPREAD) { |
| 3906 | fxCoderAddByte(param, 1, XS_CODE_UNDEFINED); |
| 3907 | fxCoderAddByte(param, 1, XS_CODE_COPY_OBJECT); |
| 3908 | fxCoderAddByte(param, 1, XS_CODE_CALL); |
| 3909 | fxCoderAddIndex(param, 1, XS_CODE_GET_LOCAL_1, object); |
| 3910 | fxNodeDispatchCode(((txSpreadNode*)item)->expression, param); |
| 3911 | fxCoderAddInteger(param, -4, XS_CODE_RUN_1, 2); |
| 3912 | fxCoderAddByte(param, -1, XS_CODE_POP); |
| 3913 | } |
| 3914 | else { |
| 3915 | txNode* value; |
| 3916 | if (item->description->token == XS_TOKEN_PROPERTY) { |
| 3917 | if (!(item->flags & mxShorthandFlag) && (((txPropertyNode*)item)->symbol == coder->parser->__proto__Symbol)) { |
| 3918 | item = item->next; |
| 3919 | continue; |
| 3920 | } |
| 3921 | value = ((txPropertyNode*)item)->value; |
| 3922 | fxCoderAddIndex(param, 1, XS_CODE_GET_LOCAL_1, object); |
| 3923 | fxNodeDispatchCode(value, param); |
| 3924 | fxCoderAddSymbol(param, -2, XS_CODE_NEW_PROPERTY, ((txPropertyNode*)item)->symbol); |
| 3925 | } |
| 3926 | else { |
| 3927 | value = ((txPropertyAtNode*)item)->value; |
| 3928 | fxCoderAddIndex(param, 1, XS_CODE_GET_LOCAL_1, object); |
| 3929 | fxNodeDispatchCode(((txPropertyAtNode*)item)->at, param); |
| 3930 | fxCoderAddByte(param, 0, XS_CODE_AT); |
| 3931 | fxNodeDispatchCode(value, param); |
| 3932 | fxCoderAddByte(param, -3, XS_CODE_NEW_PROPERTY_AT); |
| 3933 | } |
| 3934 | flag = 0; |
nothing calls this directly
no test coverage detected