Home
last modified time | relevance | path

Searched refs:indexOf (Results 1 – 25 of 1349) sorted by relevance

12345678910>>...54

/third_party/jerryscript/tests/jerry/
Dstring-prototype-indexof.js26 assert(Object.getOwnPropertyDescriptor(String.prototype.indexOf, 'length').configurable === length_…
28 assert(Object.getOwnPropertyDescriptor(String.prototype.indexOf, 'length').enumerable === false);
30 assert(Object.getOwnPropertyDescriptor(String.prototype.indexOf, 'length').writable === false);
32 assert(String.prototype.indexOf.length === 1);
34 assert("Hello world, welcome to the universe.".indexOf("welcome") === 13);
36 assert("Hello world, welcome to the universe.".indexOf("Hello world, welcome to the universe.") ===…
38 assert("Hello world, welcome to the universe.".indexOf("welcome",10) == 13);
40 assert("Hello world, welcome to the universe.".indexOf("welcome",-100) == 13);
42 assert("Hello world, welcome to the universe.".indexOf("welcome", 15) === -1);
44 assert("Hello world, welcome to the universe.".indexOf("o", 15) === 17);
[all …]
Darray-prototype-indexof.js18 var index = array.indexOf("foo");
22 assert(array.indexOf("foo", 1) === 4);
23 assert(array.indexOf("foo", 5) === -1);
25 var index = array.indexOf("baz");
29 assert(array.indexOf("baz", 7) === -1);
31 var index = array.indexOf(obj);
35 assert(array.indexOf("foo", NaN) === 0);
36 assert(array.indexOf("foo", Infinity) === -1);
37 assert(array.indexOf("foo", -Infinity) === 0);
39 assert([true].indexOf(true, -0) === 0);
[all …]
Dobject-get-own-property-names.js19 assert (props.indexOf("0") !== -1);
20 assert (props.indexOf("1") !== -1);
21 assert (props.indexOf("2") !== -1);
22 assert (props.indexOf("length") !== -1);
29 assert (props.indexOf("key1") !== -1);
30 assert (props.indexOf("key2") !== -1);
31 assert (props.indexOf("key3") !== -1);
32 assert (props.indexOf("key4") !== -1);
33 assert (props.indexOf("key5") !== -1);
44 assert (props.indexOf("key_one") !== -1);
[all …]
Dobject-keys.js19 assert (props.indexOf("0") !== -1);
20 assert (props.indexOf("1") !== -1);
21 assert (props.indexOf("2") !== -1);
28 assert (props.indexOf("key1") !== -1);
29 assert (props.indexOf("key2") !== -1);
30 assert (props.indexOf("key3") !== -1);
31 assert (props.indexOf("key4") !== -1);
32 assert (props.indexOf("key5") !== -1);
43 assert (props.indexOf("key_one") !== -1);
44 assert (props.indexOf("key_two") === -1);
[all …]
/third_party/node/test/parallel/
Dtest-buffer-indexof.js14 assert.strictEqual(b.indexOf('a'), 0);
15 assert.strictEqual(b.indexOf('a', 1), -1);
16 assert.strictEqual(b.indexOf('a', -1), -1);
17 assert.strictEqual(b.indexOf('a', -4), -1);
18 assert.strictEqual(b.indexOf('a', -b.length), 0);
19 assert.strictEqual(b.indexOf('a', NaN), 0);
20 assert.strictEqual(b.indexOf('a', -Infinity), 0);
21 assert.strictEqual(b.indexOf('a', Infinity), -1);
22 assert.strictEqual(b.indexOf('bc'), 1);
23 assert.strictEqual(b.indexOf('bc', 2), -1);
[all …]
/third_party/typescript/tests/baselines/reference/
Dparser15.4.4.14-9-2.types9 * @description Array.prototype.indexOf must return correct index (Number)
63 if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3)
64indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) a.indexOf(0) === 7 && // a…
65 >a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) a.indexOf(0) === 7 && //…
66 >a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3) a.indexOf(0) === 7 : boolean
67 >a.indexOf(-(4/3)) === 14 : boolean
68 >a.indexOf(-(4/3)) : number
69 >a.indexOf : (searchElement: boolean, fromIndex?: number) => number
71 >indexOf : (searchElement: boolean, fromIndex?: number) => number
79 a.indexOf(0) === 7 && // a[7] = +0, 0===+0
[all …]
Dparser15.4.4.14-9-2.symbols9 * @description Array.prototype.indexOf must return correct index (Number)
34 if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3)
35 >a.indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --))
37 >indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --))
39 a.indexOf(0) === 7 && // a[7] = +0, 0===+0
40 >a.indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --))
42 >indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --))
44 a.indexOf(-0) === 7 && // a[7] = +0, -0===+0
45 >a.indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --))
47 >indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --))
[all …]
Dparser15.4.4.14-9-2.js18 if (a.indexOf(-(4/3)) === 14 && // a[14]=_float===-(4/3)
19 a.indexOf(0) === 7 && // a[7] = +0, 0===+0
20 a.indexOf(-0) === 7 && // a[7] = +0, -0===+0
21 a.indexOf(1) === 10 ) // a[10] =one=== 1
44 if (a.indexOf(-(4 / 3)) === 14 && // a[14]=_float===-(4/3)
45 a.indexOf(0) === 7 && // a[7] = +0, 0===+0
46 a.indexOf(-0) === 7 && // a[7] = +0, -0===+0
47 a.indexOf(1) === 10) // a[10] =one=== 1
DtemplateStringWithPropertyAccess.symbols2 `abc${0}abc`.indexOf(`abc`);
3 >`abc${0}abc`.indexOf : Symbol(String.indexOf, Decl(lib.es5.d.ts, --, --))
4 >indexOf : Symbol(String.indexOf, Decl(lib.es5.d.ts, --, --))
DtemplateStringWithPropertyAccessES6.symbols2 `abc${0}abc`.indexOf(`abc`);
3 >`abc${0}abc`.indexOf : Symbol(String.indexOf, Decl(lib.es5.d.ts, --, --))
4 >indexOf : Symbol(String.indexOf, Decl(lib.es5.d.ts, --, --))
/third_party/jerryscript/tests/jerry/es2015/
Dtypedarray-prototype-indexof.js30 e.prototype.indexOf.call (undefined); method in e
36 var index = e.indexOf(0);
41 assert(e.indexOf(0, 1) === 4);
42 assert(e.indexOf(0, 5) === -1);
43 assert(e.indexOf(3, -2) === -1);
44 assert(e.indexOf(5, -6) === 5);
45 assert(e.indexOf(2, -2) === -1);
48 assert(e.indexOf() === -1);
51 assert(e.indexOf("foo") === -1);
52 assert(e.indexOf(3, "foo") === 3);
[all …]
Dobject-get-own-property-symbols.js25 assert (props.indexOf ('0') === -1);
26 assert (props.indexOf ('1') === -1);
27 assert (props.indexOf ('2') === -1);
28 assert (props.indexOf ('length') === -1);
39 assert (props.indexOf(a) !== -1);
40 assert (props.indexOf(b) !== -1);
41 assert (props.indexOf(c) !== -1);
42 assert (props.indexOf(d) !== -1);
58 assert (props.indexOf (fooSymbol1) !== -1);
59 assert (props.indexOf (fooSymbol2) !== -1);
[all …]
/third_party/typescript_eslint/packages/eslint-plugin/docs/rules/
Dprefer-includes.md1 # Enforce `includes` method over `indexOf` method (`prefer-includes`)
3 Until ES5, we were using `String#indexOf` method to check whether a string contains an arbitrary su…
4 Until ES2015, we were using `Array#indexOf` method to check whether an array contains an arbitrary …
11 This rule is aimed at suggesting `includes` method if `indexOf` method was used to check whether an…
13 If the receiver object of the `indexOf` method call has `includes` method and the two methods have …
26 indexOf(x: any): number;
30 str.indexOf(value) !== -1;
31 array.indexOf(value) !== -1;
32 readonlyArray.indexOf(value) === -1;
33 typedArray.indexOf(value) > -1;
[all …]
/third_party/typescript/src/testRunner/unittests/
DincrementalParser.ts132 const semicolonIndex = source.indexOf(";");
147 const index = source.indexOf("+ 1");
157 const semicolonIndex = source.indexOf(";}");
167 const semicolonIndex = source.indexOf(";");
177 const semicolonIndex = source.indexOf(";");
205 const index = source.indexOf(";");
220 const semicolonIndex = source.indexOf(";");
231 const index = source.indexOf(": string");
242 const index = source.indexOf("<<");
270 const index = source.indexOf("f");
[all …]
/third_party/node/deps/npm/node_modules/nopt/lib/
Dnopt.js75 if ((val === "null" && ~type.indexOf(null))
77 (~type.indexOf(true) || ~type.indexOf(Boolean)))
79 (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
82 } else if (~type.indexOf(Number) && !isNaN(val)) {
85 } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
96 if (val === false && ~type.indexOf(null) &&
97 !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
118 if (!val.length && type.indexOf(Array) === -1) {
119 debug('VAL HAS NO LENGTH, DELETE IT', val, k, type.indexOf(Array))
262 var at = arg.indexOf('=')
[all …]
/third_party/icu/icu4j/tools/misc/src/com/ibm/icu/dev/tool/translit/
DWriteIndicCharts.java108 … if(UCharacter.getExtendedName(UTF16.charAt(temp[k],0)).indexOf("unassigned")<0 || in writeIICharts()
109 temp[k].indexOf(":UNASSIGNED")<0){ in writeIICharts()
123 if(temp[j].indexOf(":FALLBACK")>=0){ in writeIICharts()
124 str = temp[j].substring(0,temp[j].indexOf(":")); in writeIICharts()
128 if(temp[j].indexOf(":UNASSIGNED")>=0){ in writeIICharts()
129 str = temp[j].substring(0,temp[j].indexOf(":")); in writeIICharts()
133 if(temp[j].indexOf(":UNMAPPED")>=0){ in writeIICharts()
134 str = temp[j].substring(0,temp[j].indexOf(":")); in writeIICharts()
137 if(temp[j].indexOf(":CONSUMED")>=0){ in writeIICharts()
138 str = temp[j].substring(0,temp[j].indexOf(":")); in writeIICharts()
[all …]
/third_party/quickjs/tests/
Dtest_builtin.js228 assert("abcabc".indexOf("cab"), 2);
229 assert("abcabc".indexOf("cab2"), -1);
230 assert("abc".indexOf("c"), 2);
232 assert("aaa".indexOf("a"), 0);
233 assert("aaa".indexOf("a", NaN), 0);
234 assert("aaa".indexOf("a", -Infinity), 0);
235 assert("aaa".indexOf("a", -1), 0);
236 assert("aaa".indexOf("a", -0), 0);
237 assert("aaa".indexOf("a", 0), 0);
238 assert("aaa".indexOf("a", 1), 1);
[all …]
/third_party/icu/tools/unicodetools/com/ibm/rbm/
DResources.java153 if (encoding.indexOf("_") < 0) return encoding.trim(); in getLanguage()
154 return encoding.substring(0, encoding.indexOf("_")); in getLanguage()
167 if (encoding.indexOf("_") < 0) return null; in getCountry()
168 String result = encoding.substring(encoding.indexOf("_")+1, encoding.length()); in getCountry()
169 if (result.indexOf("_") < 0) return result.trim(); in getCountry()
170 return result.substring(0, encoding.indexOf("_")); in getCountry()
184 if (encoding.indexOf("_") < 0) return null; in getVariant()
185 String result = encoding.substring(encoding.indexOf("_")+1, encoding.length()); in getVariant()
186 if (result.indexOf("_") < 0) return null; in getVariant()
187 result = result.substring(result.indexOf("_")+1, result.length()); in getVariant()
/third_party/icu/ohos_icu4j/src/main/tests/ohos/global/icu/dev/test/util/
DLocaleDataTest.java60 if(fullLoc.toString().indexOf("_BZ") >= 0 || fullLoc.toString().indexOf("_CA") >= 0 || in TestPaperSize()
61 … fullLoc.toString().indexOf("_CL") >= 0 || fullLoc.toString().indexOf("_CO") >= 0 || in TestPaperSize()
62 … fullLoc.toString().indexOf("_CR") >= 0 || fullLoc.toString().indexOf("_GT") >= 0 || in TestPaperSize()
63 … fullLoc.toString().indexOf("_MX") >= 0 || fullLoc.toString().indexOf("_NI") >= 0 || in TestPaperSize()
64 … fullLoc.toString().indexOf("_PA") >= 0 || fullLoc.toString().indexOf("_PH") >= 0 || in TestPaperSize()
65 … fullLoc.toString().indexOf("_PR") >= 0 || fullLoc.toString().indexOf("_SV") >= 0 || in TestPaperSize()
66 … fullLoc.toString().indexOf("_US") >= 0 || fullLoc.toString().indexOf("_VE") >= 0 ){ in TestPaperSize()
98 …if(fullLoc.toString().indexOf("_US") >= 0 || fullLoc.toString().indexOf("_MM") >= 0 || fullLoc.toS… in TestMeasurementSystem()
104 } else if(fullLoc.toString().indexOf("_GB") >= 0){ in TestMeasurementSystem()
219 if(locale.toString().indexOf(("in"))<0){ in TestExemplarSet()
[all …]
/third_party/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/
DLocaleDataTest.java57 if(fullLoc.toString().indexOf("_BZ") >= 0 || fullLoc.toString().indexOf("_CA") >= 0 || in TestPaperSize()
58 … fullLoc.toString().indexOf("_CL") >= 0 || fullLoc.toString().indexOf("_CO") >= 0 || in TestPaperSize()
59 … fullLoc.toString().indexOf("_CR") >= 0 || fullLoc.toString().indexOf("_GT") >= 0 || in TestPaperSize()
60 … fullLoc.toString().indexOf("_MX") >= 0 || fullLoc.toString().indexOf("_NI") >= 0 || in TestPaperSize()
61 … fullLoc.toString().indexOf("_PA") >= 0 || fullLoc.toString().indexOf("_PH") >= 0 || in TestPaperSize()
62 … fullLoc.toString().indexOf("_PR") >= 0 || fullLoc.toString().indexOf("_SV") >= 0 || in TestPaperSize()
63 … fullLoc.toString().indexOf("_US") >= 0 || fullLoc.toString().indexOf("_VE") >= 0 ){ in TestPaperSize()
95 if(fullLoc.toString().indexOf("_US") >= 0 || fullLoc.toString().indexOf("_LR") >= 0){ in TestMeasurementSystem()
101 … } else if(fullLoc.toString().indexOf("_GB") >= 0 || fullLoc.toString().indexOf("_MM") >= 0){ in TestMeasurementSystem()
212 if(locale.toString().indexOf(("in"))<0){ in TestExemplarSet()
[all …]
/third_party/icu/icu4j/tools/misc/src/com/ibm/icu/dev/tool/layout/
DModuleWriter.java132 if(what.equals("script") && inputText.indexOf("Script=") >= 0){ in readFile()
133 … previousTotalScripts = Integer.parseInt(inputText.substring(inputText.indexOf("=")+1)); in readFile()
134 }else if(what.equals("languages") && inputText.indexOf("Language=") >= 0){ in readFile()
135 … previousTotalLanguages = Integer.parseInt(inputText.substring(inputText.indexOf("=")+1)); in readFile()
136 }else if(what.equals("script") && inputText.indexOf("Scripts={") >= 0){ in readFile()
137 while((versionToAdd=reader.readLine()).indexOf("}") == -1){ in readFile()
140 }else if(what.equals("languages") && inputText.indexOf("Languages={") >= 0){ in readFile()
141 while((versionToAdd=reader.readLine()).indexOf("}") == -1){ in readFile()
/third_party/node/deps/icu-small/source/common/
Dstatic_unicode_sets.cpp94 if (str.indexOf(u'.') != -1) { in put()
96 } else if (str.indexOf(u',') != -1) { in put()
98 } else if (str.indexOf(u'+') != -1) { in put()
100 } else if (str.indexOf(u'-') != -1) { in put()
102 } else if (str.indexOf(u'$') != -1) { in put()
104 } else if (str.indexOf(u'£') != -1) { in put()
106 } else if (str.indexOf(u'₹') != -1) { in put()
108 } else if (str.indexOf(u'¥') != -1) { in put()
110 } else if (str.indexOf(u'₩') != -1) { in put()
112 } else if (str.indexOf(u'%') != -1) { in put()
[all …]
/third_party/icu/icu4c/source/common/
Dstatic_unicode_sets.cpp94 if (str.indexOf(u'.') != -1) { in put()
96 } else if (str.indexOf(u',') != -1) { in put()
98 } else if (str.indexOf(u'+') != -1) { in put()
100 } else if (str.indexOf(u'-') != -1) { in put()
102 } else if (str.indexOf(u'$') != -1) { in put()
104 } else if (str.indexOf(u'£') != -1) { in put()
106 } else if (str.indexOf(u'₹') != -1) { in put()
108 } else if (str.indexOf(u'¥') != -1) { in put()
110 } else if (str.indexOf(u'₩') != -1) { in put()
112 } else if (str.indexOf(u'%') != -1) { in put()
[all …]
/third_party/icu/ohos_icu4j/src/main/java/ohos/global/icu/impl/
DStaticUnicodeSets.java204 if (str.indexOf('.') != -1) { in put()
206 } else if (str.indexOf(',') != -1) { in put()
208 } else if (str.indexOf('+') != -1) { in put()
210 } else if (str.indexOf('-') != -1) { in put()
212 } else if (str.indexOf('$') != -1) { in put()
214 } else if (str.indexOf('£') != -1) { in put()
216 } else if (str.indexOf('₹') != -1) { in put()
218 } else if (str.indexOf('¥') != -1) { in put()
220 } else if (str.indexOf('₩') != -1) { in put()
222 } else if (str.indexOf('%') != -1) { in put()
[all …]
/third_party/icu/icu4j/main/classes/core/src/com/ibm/icu/impl/
DStaticUnicodeSets.java197 if (str.indexOf('.') != -1) { in put()
199 } else if (str.indexOf(',') != -1) { in put()
201 } else if (str.indexOf('+') != -1) { in put()
203 } else if (str.indexOf('-') != -1) { in put()
205 } else if (str.indexOf('$') != -1) { in put()
207 } else if (str.indexOf('£') != -1) { in put()
209 } else if (str.indexOf('₹') != -1) { in put()
211 } else if (str.indexOf('¥') != -1) { in put()
213 } else if (str.indexOf('₩') != -1) { in put()
215 } else if (str.indexOf('%') != -1) { in put()
[all …]

12345678910>>...54