![]() ![]() ![]() Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. The possible values are: "string", "descriptor".ĪCopyright & Software License Copyright NoticeĪll Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. The integer index of the next string index to be examined by this iteration.Ī String value that identifies what is to be returned for each element of the iteration. The String value whose elements are being iterated. Table 1: Internal Slots of String Iterator Instances String Iterator instances are initially created with the internal slots listed in Table 1. String Iterator instances are ordinary objects that inherit properties from the %StringIteratorPrototype% intrinsic object. Return CreateIterResultObject( resultString result, false).Ģ.3Properties of String Iterator Instances.Perform CreateDataProperty( result, "codePoint", first).If itemKind is "string", let result be the String value consisting of the single code unit first.Let resultSize be the number of code units in resultString.Return CreateIterResultObject( result, false).Perform CreateDataProperty( result, "codePoint", resultCp).Perform CreateDataProperty( result, "position", position).Let resultCp be UTF16Decode( first, second).If itemKind is "string", let result be the string-concatenation of the code unit first and the code unit second.If second ≥ 0xDC00 and second ≤ 0xDFFF, then.Else, let resultString be the string-concatenation of the code unit first and the code unit second.If first ≥ 0xD800 and first ≤ 0xDBFF and position+1 0xDFFF, let resultString be the String value consisting of the single code unit first.If first 0xDBFF or position+1 = len, let resultString be the String value consisting of the single code unit first.Let first be the numeric value of the code unit at index position within s.Return CreateIterResultObject( result, true).Return CreateIterResultObject( undefined, true).Perform CreateDataProperty( result, "codePoint", undefined).Perform CreateDataProperty( result, "position", len).Let result be ObjectCreate( %ObjectPrototype%).If itemKind is "string", let result be undefined.If s is undefined, return CreateIterResultObject( undefined, true).If O does not have all of the internal slots of a String Iterator Instance ( 2.3), throw a TypeError exception.If Type( O) is not Object, throw a TypeError exception.Set iterator.] to kind.Ģ.2The %StringIteratorPrototype% Object 2.2.1%StringIteratorPrototype%.next ( ).Let iterator be ObjectCreate( %StringIteratorPrototype%, « ], ] »).The abstract operation CreateStringIterator with argument string is used to create such iterator objects. Several methods of String objects return Iterator objects. ![]() Return CreateStringIterator( S, "descriptor").ĢString Iterator Objects 2.1CreateStringIterator ( string, kind ).When the codePoints method is called it returns an Iterator object ( 25.1.1.2) that iterates over the code points of a String value, returning a descriptor consisting of position within a string and code point itself as a Number value. The value of the name property of this function is "". Return CreateStringIterator( S, "string").Let O be ? RequireObjectCoercible( this value).When the method is called it returns an Iterator object ( 25.1.1.2) that iterates over the code points of a String value, returning each code point as a String value. Stage 1 Draft / 1Properties of the String Prototype Object 1.1String.prototype ( ) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |