MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxNewRegExpInstance

Function fxNewRegExpInstance

xs/sources/xsRegExp.c:190–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190txSlot* fxNewRegExpInstance(txMachine* the)
191{
192#if mxRegExp
193 txSlot* instance;
194 txSlot* property;
195 instance = fxNewObjectInstance(the);
196
197 property = instance->next = fxNewSlot(the);
198 property->flag = XS_INTERNAL_FLAG;
199 property->kind = XS_REGEXP_KIND;
200 property->value.regexp.code = C_NULL;
201 property->value.regexp.data = C_NULL;
202
203 property = property->next = fxNewSlot(the);
204 property->flag = XS_INTERNAL_FLAG;
205 property->kind = (mxEmptyString.kind == XS_STRING_X_KIND) ? XS_KEY_X_KIND : XS_KEY_KIND;
206 property->value.key.string = mxEmptyString.value.string;
207 property->value.key.sum = 0;
208
209 property = fxNextIntegerProperty(the, property, 0, mxID(_lastIndex), XS_DONT_DELETE_FLAG | XS_DONT_ENUM_FLAG);
210
211 return instance;
212#else
213 return NULL;
214#endif
215}
216
217void fx_RegExp(txMachine* the)
218{

Callers 2

fx_RegExpFunction · 0.85

Calls 3

fxNewObjectInstanceFunction · 0.85
fxNewSlotFunction · 0.85
fxNextIntegerPropertyFunction · 0.85

Tested by

no test coverage detected