Changeset 1799 in webkit for trunk/JavaScriptCore/kjs/string_object.cpp
- Timestamp:
- Aug 12, 2002, 1:14:02 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/string_object.cpp
r1623 r1799 90 90 Value protect(this); 91 91 // The constructor will be added later, after StringObjectImp has been built 92 put(exec, "length",Number(0),DontDelete|ReadOnly|DontEnum);92 put(exec,lengthPropertyName,Number(0),DontDelete|ReadOnly|DontEnum); 93 93 94 94 } … … 107 107 { 108 108 Value protect(this); 109 put(exec, "length",Number(len),DontDelete|ReadOnly|DontEnum);109 put(exec,lengthPropertyName,Number(len),DontDelete|ReadOnly|DontEnum); 110 110 } 111 111 … … 343 343 if (u.isEmpty() && !reg.match(u, 0).isNull()) { 344 344 // empty string matched by regexp -> empty array 345 res.put(exec, "length", Number(0));345 res.put(exec,lengthPropertyName, Number(0)); 346 346 break; 347 347 } … … 357 357 pos = mpos + (mstr.isEmpty() ? 1 : mstr.size()); 358 358 if (mpos != p0 || !mstr.isEmpty()) { 359 res.put(exec, UString::from(i), String(u.substr(p0, mpos-p0)));359 res.put(exec,i, String(u.substr(p0, mpos-p0))); 360 360 p0 = mpos + mstr.size(); 361 361 i++; … … 367 367 if (u.isEmpty()) { 368 368 // empty separator matches empty string -> empty array 369 put(exec, "length", Number(0));369 put(exec,lengthPropertyName, Number(0)); 370 370 break; 371 371 } else { 372 372 while (i != d && i < u.size()-1) 373 res.put(exec, UString::from(i++), String(u.substr(p0++, 1)));373 res.put(exec, i++, String(u.substr(p0++, 1))); 374 374 } 375 375 } else { 376 376 while (i != d && (pos = u.find(u2, p0)) >= 0) { 377 res.put(exec, UString::from(i), String(u.substr(p0, pos-p0)));377 res.put(exec, i, String(u.substr(p0, pos-p0))); 378 378 p0 = pos + u2.size(); 379 379 i++; … … 383 383 // add remaining string, if any 384 384 if (i != d) 385 res.put(exec, UString::from(i++), String(u.substr(p0)));386 res.put(exec, "length", Number(i));385 res.put(exec, i++, String(u.substr(p0))); 386 res.put(exec,lengthPropertyName, Number(i)); 387 387 } 388 388 break; … … 498 498 Value protect(this); 499 499 // ECMA 15.5.3.1 String.prototype 500 put(exec,"prototype", Object(stringProto), DontEnum|DontDelete|ReadOnly); 501 502 put(exec,"fromCharCode", Object(new StringObjectFuncImp(exec,funcProto)), DontEnum); 500 put(exec,prototypePropertyName, Object(stringProto), DontEnum|DontDelete|ReadOnly); 501 502 static UString fromCharCode("fromCharCode"); 503 put(exec,fromCharCode, Object(new StringObjectFuncImp(exec,funcProto)), DontEnum); 503 504 504 505 // no. of arguments for constructor 505 put(exec, "length", Number(1), ReadOnly|DontDelete|DontEnum);506 put(exec,lengthPropertyName, Number(1), ReadOnly|DontDelete|DontEnum); 506 507 } 507 508 … … 525 526 526 527 obj.setInternalValue(String(s)); 527 obj.put(exec, "length", Number(s.size()), ReadOnly|DontEnum|DontDelete);528 obj.put(exec, lengthPropertyName, Number(s.size()), ReadOnly|DontEnum|DontDelete); 528 529 529 530 return obj; … … 553 554 { 554 555 Value protect(this); 555 put(exec, "length",Number(1),DontDelete|ReadOnly|DontEnum);556 put(exec,lengthPropertyName,Number(1),DontDelete|ReadOnly|DontEnum); 556 557 } 557 558
Note:
See TracChangeset
for help on using the changeset viewer.