Lines Matching defs:eng
35 QScriptEngine eng;
42 QScriptValue v(&eng, QScriptValue::UndefinedValue);
46 QCOMPARE(v.engine(), &eng);
49 QScriptValue v(&eng, QScriptValue::NullValue);
53 QCOMPARE(v.engine(), &eng);
56 QScriptValue v(&eng, false);
62 QCOMPARE(v.engine(), &eng);
65 QScriptValue v(&eng, int(1));
70 QCOMPARE(v.engine(), &eng);
78 QScriptValue v(&eng, uint(1));
83 QCOMPARE(v.engine(), &eng);
91 QScriptValue v(&eng, 1.0);
96 QCOMPARE(v.engine(), &eng);
104 QScriptValue v(&eng, "ciao");
109 QCOMPARE(v.engine(), &eng);
112 QScriptValue v(&eng, QString("ciao"));
117 QCOMPARE(v.engine(), &eng);
121 QScriptValue v(&eng, 1.0);
124 QCOMPARE(v2.engine(), &eng);
129 QCOMPARE(v3.engine(), &eng);
131 QScriptValue v4(&eng, 2.0);
411 QScriptEngine eng;
413 QScriptValue object = eng.newObject();
415 QScriptValue str = QScriptValue(&eng, "bar");
419 QScriptValue num = QScriptValue(&eng, 123.0);
427 QCOMPARE(strstr.engine(), &eng); // the value has been bound to the engine
437 QScriptValue array = eng.newArray();
446 array.setProperty("length", QScriptValue(&eng, 1));
451 QVERIFY(eng.evaluate("a = []; a['00'] = 123; a['00']").strictlyEquals(QScriptValue(&eng, 123)));
452 QVERIFY(eng.evaluate("a.length").strictlyEquals(QScriptValue(&eng, 0)));
453 QVERIFY(eng.evaluate("a.hasOwnProperty('00')").strictlyEquals(QScriptValue(&eng, true)));
454 QVERIFY(eng.evaluate("a.hasOwnProperty('0')").strictlyEquals(QScriptValue(&eng, false)));
455 QVERIFY(eng.evaluate("a[0]").isUndefined());
456 QVERIFY(eng.evaluate("a[0.5] = 456; a[0.5]").strictlyEquals(QScriptValue(&eng, 456)));
457 QVERIFY(eng.evaluate("a.length").strictlyEquals(QScriptValue(&eng, 0)));
458 QVERIFY(eng.evaluate("a.hasOwnProperty('0.5')").strictlyEquals(QScriptValue(&eng, true)));
459 QVERIFY(eng.evaluate("a[0]").isUndefined());
460 QVERIFY(eng.evaluate("a[0] = 789; a[0]").strictlyEquals(QScriptValue(&eng, 789)));
461 QVERIFY(eng.evaluate("a.length").strictlyEquals(QScriptValue(&eng, 1)));
464 eng.evaluate("a = []; a[0x800000000] = 123");
465 QVERIFY(eng.evaluate("a.length").strictlyEquals(QScriptValue(&eng, 0)));
466 QVERIFY(eng
467 QVERIFY(eng.evaluate("a[0x800000000]").strictlyEquals(QScriptValue(&eng, 123)));
476 QScriptValue object2 = eng.newObject();
478 QScriptValue num2 = QScriptValue(&eng, 456.0);
494 QScriptValue object3 = eng.newObject();
511 eng.globalObject().setProperty("object3", object3);
512 QCOMPARE(eng.evaluate("object3.hasOwnProperty('foo')")
513 .strictlyEquals(QScriptValue(&eng, false)), true);
515 QCOMPARE(eng.evaluate("object3.hasOwnProperty('foo')")
516 .strictlyEquals(QScriptValue(&eng, true)), true);
517 eng.globalObject().setProperty("object3", QScriptValue());
518 QCOMPARE(eng.evaluate("this.hasOwnProperty('object3')")
519 .strictlyEquals(QScriptValue(&eng, false)), true);
521 eng.globalObject().setProperty("object", object);
527 eng.evaluate("object.readOnlyProperty = !object.readOnlyProperty");
531 QScriptValue ret = eng.evaluate(
538 QCOMPARE(ret.strictlyEquals(QScriptValue(&eng, true)), true);
542 QScriptValue ret = eng.evaluate("delete object.readOnlyProperty");
543 QCOMPARE(ret.strictlyEquals(QScriptValue(&eng, true)), true);
552 QScriptValue ret = eng.evaluate("delete object.undeletableProperty");
553 QCOMPARE(ret.strictlyEquals(QScriptValue(&eng, true)), false);
557 eng.evaluate("object.undeletableProperty = object.undeletableProperty + 1");
561 QScriptValue ret = eng.evaluate(
568 QCOMPARE(ret.strictlyEquals(QScriptValue(&eng, true)), true);
583 QScriptValue ret = eng.evaluate(
590 QCOMPARE(ret.strictlyEquals(QScriptValue(&eng, false)), true);
593 eng.evaluate("object.dontEnumProperty = object.dontEnumProperty + 1");
597 QScriptValue ret = eng.evaluate("delete object.dontEnumProperty");
598 QCOMPARE(ret.strictlyEquals(QScriptValue(&eng, true)), true);
620 QScriptValue object2 = eng.newObject();
627 QScriptString foo = eng.toStringHandle("foo");
837 QScriptEngine eng;
839 QScriptValue undefined = eng.undefinedValue();
841 QScriptValue null = eng.nullValue();
845 QScriptValue falskt = QScriptValue(&eng, false);
853 QScriptValue sant = QScriptValue(&eng, true);
861 QScriptValue number = QScriptValue(&eng, 123.0);
869 QScriptValue str = QScriptValue(&eng, QString("ciao"));
878 QScriptValue object = eng
890 QVERIFY(!eng.toObject(undefined).isValid());
895 QVERIFY(!eng.toObject(null).isValid());
903 QScriptValue tmp = eng.toObject(falskt);
914 QScriptValue tmp = eng.toObject(sant);
925 QScriptValue tmp = eng.toObject(number);
936 QScriptValue tmp = eng.toObject(str);